| Class | Expect |
| In: |
lib/facet/expect.rb
|
| Parent: | Object |
Given an IO object, read data from that object and expect certain data.
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.
require 'carat/expect' # to do
Adopted from Ruby Treasures 0.4 Copyright (C) 2002 Paul Brannan <paul@atdesk.com>
You may distribute this software under the same terms as Ruby (see the file COPYING that was distributed with this library).
$Id: expect.rb, v0.4 2004/11/30 transami Exp $
| VERSION | = | "0.4" |
| timeout | [RW] | It is highly recommended that this be an immutable object. |
Create a new Expect_Test object.
@param io_object an IO object to read from. @param reactor a reactor to use
Expect a message matching pattern in a certain chain.
@param pattern the pattern to expect. @param chain the chain in which to expect the message.