OSDN Git Service

Replaced mongrel with thin
[redminele/redminele.git] / ruby / lib / ruby / gems / 1.8 / gems / eventmachine-0.12.10-x86-mswin32-60 / tests / test_handler_check.rb
1 $:.unshift "../lib"\r
2 require 'eventmachine'\r
3 require 'test/unit'\r
4 \r
5 class TestHandlerCheck < Test::Unit::TestCase\r
6 \r
7   class Foo < EM::Connection; end;\r
8   module TestModule; end;\r
9 \r
10   def test_with_correct_class\r
11     assert_nothing_raised do\r
12       EM.run {\r
13         EM.connect("127.0.0.1", 80, Foo)\r
14         EM.stop_event_loop\r
15       }\r
16     end\r
17   end\r
18 \r
19   def test_with_incorrect_class\r
20     assert_raise(ArgumentError) do\r
21       EM.run {\r
22         EM.connect("127.0.0.1", 80, String)\r
23         EM.stop_event_loop\r
24       }\r
25     end\r
26   end\r
27 \r
28   def test_with_module\r
29     assert_nothing_raised do\r
30       EM.run {\r
31         EM.connect("127.0.0.1", 80, TestModule)\r
32         EM.stop_event_loop\r
33       }\r
34     end\r
35   end\r
36 \r
37 end