Skip to content

Commit

Permalink
Added Tests to appease Gregors
Browse files Browse the repository at this point in the history
  • Loading branch information
krankin committed May 1, 2012
1 parent 487b5e7 commit 07aa808
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions server_tests.rb
@@ -0,0 +1,23 @@
require 'test/unit'
require File.dirname(__FILE__) + "/server"
require "socket"

class ServerTest < Test::Unit::TestCase

def test_server_created_
s= PortServer.new(1234)
assert_not_nil(s)
end

def test_server_port_assignment
s= PortServer.new(1234)
assert_equal(s.port,1234)
end

def test_server_has_connection
s = PortServer.new(1234)
s.start
c = TCPSocket.new("localhost",1234)
assert_equal(1,s.connections)
end
end

0 comments on commit 07aa808

Please sign in to comment.