Sha256: 6cc1f09336257a7e42dac16d35740e9814fd8d4ac9fcaf390b7d2199beac8caf

Contents?: true

Size: 355 Bytes

Versions: 7

Compression:

Stored size: 355 Bytes

Contents

class FakeTCPSocket

  def readline(some_text = nil)
    return @canned_response
  end

  def flush
  end

  def write(some_text = nil)
  end

  def readchar
    return 6
  end

  def read(num)
    return num > @canned_response.size ? @canned_response : @canned_response[0..num]
  end

  def set_canned(response)
    @canned_response = response
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
gearman-ruby-4.0.5 spec/support/fake_tcp_socket.rb
gearman-ruby-4.0.4 spec/support/fake_tcp_socket.rb
gearman-ruby-4.0.3 spec/support/fake_tcp_socket.rb
gearman-ruby-4.0.2 spec/support/fake_tcp_socket.rb
gearman-ruby-3.0.8 spec/support/fake_tcp_socket.rb
gearman-ruby-3.0.7 spec/support/fake_tcp_socket.rb
gearman-ruby-3.0.6 spec/support/fake_tcp_socket.rb