Ticket #5: test_connection_without_send.rb
| File test_connection_without_send.rb, 1.0 kB (added by rogerdpack, 5 months ago) |
|---|
| Line | |
|---|---|
| 1 | # |
| 2 | # Homepage:: http://rubyeventmachine.com |
| 3 | # Date:: 8 April 2006 |
| 4 | # |
| 5 | # See EventMachine and EventMachine::Connection for documentation and |
| 6 | # usage examples. |
| 7 | # |
| 8 | #---------------------------------------------------------------------------- |
| 9 | # |
| 10 | # Copyright (C) 2006-07 by Francis Cianfrocca. All Rights Reserved. |
| 11 | # Gmail: blackhedd |
| 12 | # |
| 13 | # This program is free software; you can redistribute it and/or modify |
| 14 | # it under the terms of either: 1) the GNU General Public License |
| 15 | # as published by the Free Software Foundation; either version 2 of the |
| 16 | # License, or (at your option) any later version; or 2) Ruby's License. |
| 17 | # |
| 18 | # See the file COPYING for complete licensing information. |
| 19 | # |
| 20 | #--------------------------------------------------------------------------- |
| 21 | # |
| 22 | # |
| 23 | # |
| 24 | |
| 25 | $:.unshift "../lib" |
| 26 | require 'eventmachine' |
| 27 | require 'test/unit' |
| 28 | |
| 29 | class TestBasic < Test::Unit::TestCase |
| 30 | |
| 31 | def setup |
| 32 | EM::kqueue |
| 33 | end |
| 34 | |
| 35 | def teardown |
| 36 | end |
| 37 | |
| 38 | def test_connection_without_write_works |
| 39 | Thread.new { |
| 40 | EM::run { |
| 41 | EM::start_server '0.0.0.0', 9000 |
| 42 | EM::connect '0.0.0.0', 9000 |
| 43 | } |
| 44 | } |
| 45 | end |
| 46 | |
| 47 | end |
| 48 |
