Class: FlexMock::AtMostCountValidator
- Inherits:
-
CountValidator
- Object
- CountValidator
- FlexMock::AtMostCountValidator
- Defined in:
- lib/flexmock/validators.rb
Overview
Validator for call counts less than or equal to a limit.
Instance Method Summary collapse
-
#describe ⇒ Object
Human readable description of the validator.
- #describe_limit ⇒ Object
-
#validate(n) ⇒ Object
Validate the method expectation was called at least
n
times.
Methods inherited from CountValidator
#eligible?, #initialize, #validate_count
Methods included from SpyDescribers
#append_call_record, #block_description, #describe_calls, #describe_spy, #describe_spy_expectation, #describe_spy_negative_expectation, #spy_description, #times_description
Constructor Details
This class inherits a constructor from FlexMock::CountValidator
Instance Method Details
#describe ⇒ Object
Human readable description of the validator
132 133 134 |
# File 'lib/flexmock/validators.rb', line 132 def describe ".at_most#{super}" end |
#describe_limit ⇒ Object
136 137 138 |
# File 'lib/flexmock/validators.rb', line 136 def describe_limit "At most #{@limit}" end |
#validate(n) ⇒ Object
Validate the method expectation was called at least n
times.
127 128 129 |
# File 'lib/flexmock/validators.rb', line 127 def validate(n) validate_count(n) { n <= @limit } end |