Sha256: 26c652e24f952c06486d6ab7ab4e7aee3aebc5d40913adc32eb28de0a3005850

Contents?: true

Size: 632 Bytes

Versions: 60

Compression:

Stored size: 632 Bytes

Contents

require 'em_test_helper'

class TestIdleConnection < Test::Unit::TestCase
  if EM.respond_to?(:get_idle_time)
    def test_idle_time
      EM.run{
        conn = EM.connect 'www.google.com', 80
        EM.add_timer(3){
          $idle_time = conn.get_idle_time
          conn.send_data "GET / HTTP/1.0\r\n\r\n"
          EM.next_tick{
            EM.next_tick{
              $idle_time_after_send = conn.get_idle_time
              conn.close_connection
              EM.stop
            }
          }
        }
      }

      assert_in_delta 3, $idle_time, 0.2
      assert_in_delta 0, $idle_time_after_send, 0.1
    end
  end
end

Version data entries

60 entries across 59 versions & 6 rubygems

Version Path
sensu-em-2.7.0-java tests/test_idle_connection.rb
arcabouco-0.2.13 vendor/bundle/gems/eventmachine-1.2.0.1/tests/test_idle_connection.rb
arcabouco-0.2.13 vendor/bundle/gems/eventmachine-1.2.1/tests/test_idle_connection.rb
eventmachine-1.2.1-java tests/test_idle_connection.rb
eventmachine-1.2.1-x64-mingw32 tests/test_idle_connection.rb
eventmachine-1.2.1-x86-mingw32 tests/test_idle_connection.rb
eventmachine-1.2.1 tests/test_idle_connection.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/eventmachine-1.2.0.1/tests/test_idle_connection.rb
sensu-em-2.6.0-java tests/test_idle_connection.rb
eventmachine-1.2.0.1-java tests/test_idle_connection.rb
eventmachine-1.2.0.1-x86-mingw32 tests/test_idle_connection.rb
eventmachine-1.2.0.1-x64-mingw32 tests/test_idle_connection.rb
eventmachine-1.2.0.1 tests/test_idle_connection.rb
eventmachine-1.2.0 tests/test_idle_connection.rb
eventmachine-1.2.0-x86-mingw32 tests/test_idle_connection.rb
eventmachine-1.2.0-x64-mingw32 tests/test_idle_connection.rb
eventmachine-1.2.0.dev.2 tests/test_idle_connection.rb
eventmachine-1.2.0.dev.2-x86-mingw32 tests/test_idle_connection.rb
eventmachine-1.2.0.dev.2-x64-mingw32 tests/test_idle_connection.rb
eventmachine-1.0.9.1 tests/test_idle_connection.rb