Sha256: 1b5c96e88009cc2d4e5088eef5eb11d598780d772a2d39a4ec286a5ec1d3024a
Contents?: true
Size: 724 Bytes
Versions: 1
Compression:
Stored size: 724 Bytes
Contents
$:.unshift "../lib" require 'eventmachine' require 'test/unit' class TestConnectionCount < Test::Unit::TestCase def test_idle_connection_count EM.run { $count = EM.connection_count EM.stop_event_loop } assert_equal(0, $count) end def test_with_some_connections EM.run { EM.start_server("127.0.0.1", 9999) EM.connect("127.0.0.1", 9999) $first_tick = EM.connection_count EM.next_tick { $second_tick = EM.connection_count EM.next_tick { $third_tick = EM.connection_count EM.stop_event_loop } } } assert_equal(0, $first_tick) assert_equal(2, $second_tick) assert_equal(3, $third_tick) end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
libc-eventmachine-0.12.5.42 | tests/test_connection_count.rb |