Class: FlexMock::CountValidator
- Defined in:
- lib/gems/flexmock-0.8.3/lib/flexmock/validators.rb
Overview
Base class for all the count validators.
Direct Known Subclasses
AtLeastCountValidator, AtMostCountValidator, ExactCountValidator
Instance Method Summary collapse
-
#eligible?(n) ⇒ Boolean
If the expectation has been called
n
times, is it still eligible to be called again? The default answer compares n to the established limit. -
#initialize(expectation, limit) ⇒ CountValidator
constructor
A new instance of CountValidator.
Constructor Details
#initialize(expectation, limit) ⇒ CountValidator
Returns a new instance of CountValidator.
20 21 22 23 |
# File 'lib/gems/flexmock-0.8.3/lib/flexmock/validators.rb', line 20 def initialize(expectation, limit) @exp = expectation @limit = limit end |
Instance Method Details
#eligible?(n) ⇒ Boolean
If the expectation has been called n
times, is it still eligible to be called again? The default answer compares n to the established limit.
28 29 30 |
# File 'lib/gems/flexmock-0.8.3/lib/flexmock/validators.rb', line 28 def eligible?(n) n < @limit end |