Class: TestObjectProtocol

Inherits:
Test::Unit::TestCase
  • Object
show all
Defined in:
lib/ext/eventmachine-0.12.10/tests/test_object_protocol.rb

Defined Under Namespace

Modules: Client, Server

Constant Summary collapse

Host =
"127.0.0.1"
Port =
9550

Instance Method Summary collapse

Instance Method Details

#test_send_receiveObject



28
29
30
31
32
33
34
35
36
# File 'lib/ext/eventmachine-0.12.10/tests/test_object_protocol.rb', line 28

def test_send_receive
  EM.run{
    EM.start_server Host, Port, Server
    EM.connect Host, Port, Client
  }

  assert($client == {:hello=>'world'})
  assert($server == {'you_said'=>{:hello=>'world'}})
end