Sha256: d2afcd25213ddc58fb2383216170d21b77822ecd7c1995e3bbaf4ccbd98bfc93

Contents?: true

Size: 653 Bytes

Versions: 4

Compression:

Stored size: 653 Bytes

Contents

require_relative 'em_test_helper'

class TestHandlerCheck < Test::Unit::TestCase

  class Foo < EM::Connection; end;
  module TestModule; end;

  def test_with_correct_class
    assert_nothing_raised do
      EM.run {
        EM.connect("127.0.0.1", 80, Foo)
        EM.stop_event_loop
      }
    end
  end

  def test_with_incorrect_class
    assert_raise(ArgumentError) do
      EM.run {
        EM.connect("127.0.0.1", 80, String)
        EM.stop_event_loop
      }
    end
  end

  def test_with_module
    assert_nothing_raised do
      EM.run {
        EM.connect("127.0.0.1", 80, TestModule)
        EM.stop_event_loop
      }
    end
  end

end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
eventmachine-mkroman-1.3.0.dev.1 tests/test_handler_check.rb
wj_eventmachine-1.3.2 tests/test_handler_check.rb
wj_eventmachine-1.3.1 tests/test_handler_check.rb
wj_eventmachine-1.3.0.dev.1 tests/test_handler_check.rb