Added a file: ruby_binding/test_camping.rb
[ebb.git] / test.rb
blobc2c66808e9838fe7387aa9833728c714597751ef
1 require 'test/unit'
2 require 'rubygems'
3 require 'ruby-debug'
4 Debugger.start
6 class ServerTest < Test::Unit::TestCase
7   def test_server
8     system %q{./tcp_test > /dev/null &}
9     sleep 0.5
10     TCPSocket.open('localhost', 1337) do |socket|
11       ["Hello", "World", "foo bar"].each do |w|
12         socket.write w
13         assert_equal w.reverse, socket.read(w.length)
14       end
15     end
16   ensure
17     system %q{killall -9 tcp_test}
18   end
19 end