znmud-0.0.1/benchmark/
znmud-0.0.1/cmd/
znmud-0.0.1/cmd/emotes/
znmud-0.0.1/cmd/objects/
znmud-0.0.1/cmd/tiny/
znmud-0.0.1/doc/
znmud-0.0.1/farts/
znmud-0.0.1/lib/
znmud-0.0.1/lib/combat/
znmud-0.0.1/lib/core/bodytypes/
znmud-0.0.1/lib/engine/
znmud-0.0.1/lib/farts/
znmud-0.0.1/logs/
#
# file::    mocksocket.rb
# author::  Jon A. Lambert
# version:: 2.6.0
# date::    10/06/2005
#
# This source code copyright (C) 2005 by Jon A. Lambert
# All rights reserved.
#
# Released under the terms of the TeensyMUD Public License
# See LICENSE file for additional information.
#

# A mocksocket spoofs the behavior of a TCPSocket for testing purposes
#
class MockSocket
  def initialize(data)
    @data = data
  end

  def recv(bufsize, flag=nil)
    @data.slice!(0...bufsize)
  end

  def send(msg, flag)
    msg.size
  end

  def close
    true
  end

  def peeraddr
    ["AF_INET", 8765, "users.house.net", "123.45.67.89"]
  end

  def addr
    ["AF_INET", 4000, "agamemnon", "10.0.0.2"]
  end

end