I have this method which does the work of sending a push notification.
def push host = 'gateway.push.apple.com' path = @cert_name ssl_client = Pushofy::ConnectionToAppleServer::ssl_connect(@host,@port, @password,'../DevCert.pem') ssl_client.connect device = [@deviceTokenHex] device_token_binary = device.pack('H*') pt = device_token_binary pm = @payload_hash.to_json message = [0, 0, 32, pt, 0, pm.size, pm].pack('ccca*cca*') ssl_client.write(message) ssl_client.flush end
How can I test that this does what it is expected to do? At the end it is simply sending sending a message to the apple server.
This method is defined on a class in the gem.