Sha256: 0f54f0c36f7eca55dd656ee59b91e611c81040c50b75ab65c50935fe572728d3

Contents?: true

Size: 409 Bytes

Versions: 7

Compression:

Stored size: 409 Bytes

Contents

module RR
module TimesCalledMatchers
  class RangeMatcher < TimesCalledMatcher
    def possible_match?(times_called)
      return true if times_called < @times.begin
      return true if @times.include?(times_called)
      return false
    end

    def matches?(times_called)
      @times.include?(times_called)
    end

    def attempt?(times_called)
      possible_match?(times_called)
    end
  end
end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rr-0.1.10 lib/rr/times_called_matchers/range_matcher.rb
rr-0.1.11 lib/rr/times_called_matchers/range_matcher.rb
rr-0.1.13 lib/rr/times_called_matchers/range_matcher.rb
rr-0.1.7 lib/rr/times_called_matchers/range_matcher.rb
rr-0.1.8 lib/rr/times_called_matchers/range_matcher.rb
rr-0.1.12 lib/rr/times_called_matchers/range_matcher.rb
rr-0.1.9 lib/rr/times_called_matchers/range_matcher.rb