TeensyMud - 'A ruby mud server.'

Browse repository
back

test_connection.rb

# Code Generated by ZenTest v. 2.3.0
# classname: asrt / meth = ratio%
# Connection: 16 / 9 = 177.78%

unless defined? $ZENTEST and $ZENTEST
require 'test/unit'
require 'network/connection'
require 'mocksocket'
end

class TestConnection < Test::Unit::TestCase
def setup
@serv = FlexMock.new
@serv.mock_handle(:service_io) { :sockio }
@serv.mock_handle(:service_filters) { [:colorfilter, :debugfilter] }
@serv.mock_handle(:service_negotiation) { [:supga, :zmp, :echo] }
@sock = MockSocket.new("hello world\r\nfoobar")
@conn = Connection.new(@serv,@sock)
end

def test_handle_close
assert_respond_to(@conn, :handle_close)
end

def test_handle_input
assert_respond_to(@conn, :handle_input)
end

def test_handle_oob
assert_respond_to(@conn, :handle_oob)
end

def test_handle_output
assert_respond_to(@conn, :handle_output)
end

def test_inbuffer
assert_equal("", @conn.inbuffer)
end

def test_inbuffer_equals
assert_equal("foo", @conn.inbuffer = "foo")
end

def test_init
assert_respond_to(@conn, :init)
end

def test_initdone
assert_equal(true, @conn.initdone)
end

def test_outbuffer
assert_equal("", @conn.outbuffer)
end

def test_outbuffer_equals
assert_equal("foo", @conn.outbuffer = "foo")
end

def test_pstack
assert_respond_to(@conn, :pstack)
end

def test_sendmsg
assert_respond_to(@conn, :sendmsg)
end

def test_server
assert_respond_to(@conn, :server)
end

def test_set_initdone
assert_respond_to(@conn, :set_initdone)
end

def test_sockio
assert_respond_to(@conn, :sockio)
end

def test_update
assert_respond_to(@conn, :update)
end
end