test_acceptor.rb

tmud-2.10.0/test/test_acceptor.rb · 675 B

From the archive tmud-2.10.0.tar.gz

Download the archive   « Back to the archive contents

# Code Generated by ZenTest v. 2.3.0
#                 classname: asrt / meth =  ratio%
#                  Acceptor:    4 /    4 = 100.00%

unless defined? $ZENTEST and $ZENTEST
require 'test/unit'
require 'network/acceptor'
require 'flexmock'
end

class TestAcceptor < Test::Unit::TestCase
  def setup
    @serv = FlexMock.new
    @serv.mock_handle(:register) { true }
    @serv.mock_handle(:port) { 9999 }
    @acceptor = Acceptor.new(@serv)
  end

  def test_handle_close
    assert_respond_to(@acceptor, :handle_close)
  end

  def test_handle_input
    assert_respond_to(@acceptor, :handle_input)
  end

  def test_init
    assert_equal(true, @acceptor.init)
  end
end

Site Stats

Snippets: 1791
Codebases: 571