Class: FlexMock::AtLeastCountValidator
- Inherits:
-
CountValidator
- Object
- CountValidator
- FlexMock::AtLeastCountValidator
- Defined in:
- lib/gems/flexmock-0.8.3/lib/flexmock/validators.rb
Overview
Validator for call counts greater than or equal to a limit.
Instance Method Summary collapse
-
#eligible?(n) ⇒ Boolean
If the expectation has been called
n
times, is it still eligible to be called again? Since this validator only establishes a lower limit, not an upper limit, then the answer is always true. -
#validate(n) ⇒ Object
Validate the method expectation was called no more than
n
times.
Methods inherited from CountValidator
Constructor Details
This class inherits a constructor from FlexMock::CountValidator
Instance Method Details
#eligible?(n) ⇒ Boolean
If the expectation has been called n
times, is it still eligible to be called again? Since this validator only establishes a lower limit, not an upper limit, then the answer is always true.
61 62 63 |
# File 'lib/gems/flexmock-0.8.3/lib/flexmock/validators.rb', line 61 def eligible?(n) true end |
#validate(n) ⇒ Object
Validate the method expectation was called no more than n
times.
51 52 53 54 55 |
# File 'lib/gems/flexmock-0.8.3/lib/flexmock/validators.rb', line 51 def validate(n) FlexMock.framework_adapter.assert_block( "Method '#{@exp}' should be called at least #{@limit} times,\n" + "only called #{n} times") { n >= @limit } end |