Class: Lookout::Expected::Lookout::Reception
- Defined in:
- lib/lookout-3.0/expected/lookout/reception.rb
Overview
Represents expected Receptions. This is used to check mock method invocation counts and arguments.
Instance Method Summary collapse
-
#difference(actual) ⇒ Difference::Lookout::Reception?
A difference report between the ACTUAL number of times the method was received and the range of expected number of receptions unless the earlier lay within the latter.
-
#expect(file, line, &block) ⇒ Expect::Object
An expect block for the receiver at LINE in FILE that’ll yield the #expected object and expect the block to call the method the appropriate number of times.
Instance Method Details
#difference(actual) ⇒ Difference::Lookout::Reception?
Returns A difference report between the ACTUAL number of times the method was received and the range of expected number of receptions unless the earlier lay within the latter.
20 21 22 23 |
# File 'lib/lookout-3.0/expected/lookout/reception.rb', line 20 def difference(actual) Lookout::Difference::Lookout::Reception. new(actual, expected) unless expected.range === actual end |
#expect(file, line, &block) ⇒ Expect::Object
Returns An expect block for the receiver at LINE in FILE that’ll yield the #expected object and expect the block to call the method the appropriate number of times.
12 13 14 |
# File 'lib/lookout-3.0/expected/lookout/reception.rb', line 12 def expect(file, line, &block) super file, line, &expected.block(&block) end |