--- /dev/null
+$:.unshift "../lib"\r
+require 'eventmachine'\r
+require 'test/unit'\r
+\r
+class TestHandlerCheck < Test::Unit::TestCase\r
+\r
+ class Foo < EM::Connection; end;\r
+ module TestModule; end;\r
+\r
+ def test_with_correct_class\r
+ assert_nothing_raised do\r
+ EM.run {\r
+ EM.connect("127.0.0.1", 80, Foo)\r
+ EM.stop_event_loop\r
+ }\r
+ end\r
+ end\r
+\r
+ def test_with_incorrect_class\r
+ assert_raise(ArgumentError) do\r
+ EM.run {\r
+ EM.connect("127.0.0.1", 80, String)\r
+ EM.stop_event_loop\r
+ }\r
+ end\r
+ end\r
+\r
+ def test_with_module\r
+ assert_nothing_raised do\r
+ EM.run {\r
+ EM.connect("127.0.0.1", 80, TestModule)\r
+ EM.stop_event_loop\r
+ }\r
+ end\r
+ end\r
+\r
+end
\ No newline at end of file