expect |
class Expect < Object |
All expected data is expected in 'chains'. When a message is received, it is compared to the pattern at the top of each chain. If it matches one of the patterns, then all is well, but an error message is printed otherwise.
A message can match patterns in more than one chain.
class UnmatchedMessage < Exception |
Public Methods |
class Timeout < Exception |
Public Methods |
class SeparatedPattern < Object |
Example:
# matches 'foo,bar' and 'bar,foo' p = SeparatorPattern.new(['foo', 'bar'])e = Expect.new(nil, nil) e.expect(p)
Public Methods |
class DefaultChain < Object |
Public Methods |
It is highly recommended that this be an immutable object.
Create a new Expect_Test object.
io_object | an IO object to read from. |
---|---|
reactor | a reactor to use |
Reset the the ignore chain and all expect chains.
Expect a message matching pattern in a certain chain.
pattern | the pattern to expect. |
---|---|
chain | the chain in which to expect the message. |
Ignore a pattern in all chains.
pattern | the pattern to ignore. |
---|