Class: RR::TimesCalledMatchers::RangeMatcher
- Inherits:
-
TimesCalledMatcher
- Object
- TimesCalledMatcher
- RR::TimesCalledMatchers::RangeMatcher
- Includes:
- Terminal
- Defined in:
- lib/rr/times_called_matchers/range_matcher.rb
Overview
:nodoc:
Instance Attribute Summary
Attributes inherited from TimesCalledMatcher
Instance Method Summary (collapse)
- - (Boolean) attempt?(times_called)
- - (Boolean) matches?(times_called)
- - (Boolean) possible_match?(times_called)
Methods included from Terminal
Methods inherited from TimesCalledMatcher
#==, #error_message, #expected_times_message, #initialize
Constructor Details
This class inherits a constructor from RR::TimesCalledMatchers::TimesCalledMatcher
Instance Method Details
- (Boolean) attempt?(times_called)
16 17 18 |
# File 'lib/rr/times_called_matchers/range_matcher.rb', line 16 def attempt?(times_called) possible_match?(times_called) end |
- (Boolean) matches?(times_called)
12 13 14 |
# File 'lib/rr/times_called_matchers/range_matcher.rb', line 12 def matches?(times_called) @times.include?(times_called) end |
- (Boolean) possible_match?(times_called)
6 7 8 9 10 |
# File 'lib/rr/times_called_matchers/range_matcher.rb', line 6 def possible_match?(times_called) return true if times_called < @times.begin return true if @times.include?(times_called) return false end |