Module: Net::SSH::Test::Extensions::PacketStream

Module | Net::SSH::Test::Extensions::PacketStream
In: | lib/net/ssh/test/extensions.rb

An extension to Net::SSH::Transport::PacketStream (assumes that the underlying IO is actually a StringIO). Facilitates unit testing.

### Methods

idle! test_available_for_read? test_enqueue_packet test_poll_next_packet

### Included Modules

BufferedIo

### Public Instance methods

idle!()

Called when another packet should be inspected from the current script. If the next packet is a remote packet, it pops it off the script and shoves it onto this IO object, making it available to be read.

test_available_for_read?()

The testing version of Net::SSH::Transport::PacketStream#available_for_read?. Returns true if there is data pending to be read. Otherwise calls idle!.

test_enqueue_packet(payload)

The testing version of Net::SSH::Transport::PacketStream#enqueued_packet. Simply calls Net::SSH::Test::Script#process on the packet.

test_poll_next_packet()

The testing version of Net::SSH::Transport::PacketStream#poll_next_packet. Reads the next available packet from the IO object and returns it.

[Validate]