Method: FlexMock#should_expect
- Defined in:
- lib/flexmock/core.rb
#should_expect {|Recorder.new(self)| ... } ⇒ Object
Declare that the mock object should expect methods by providing a recorder for the methods and having the user invoke the expected methods in a block. Further expectations may be applied the result of the recording call.
Example Usage:
mock.should_expect do |record|
record.add(Integer, 4) { |a, b|
a + b
}.at_least.once
223 224 225 |
# File 'lib/flexmock/core.rb', line 223 def should_expect yield Recorder.new(self) end |