Sha256: 7c3e8f63a8c8838eb0190fa2d0fd99e1a25281839556ea55b0c34f022d46b866

Contents?: true

Size: 408 Bytes

Versions: 7

Compression:

Stored size: 408 Bytes

Contents

module RR
module TimesCalledMatchers
  class AtMostMatcher < TimesCalledMatcher
    def possible_match?(times_called)
      times_called <= @times
    end

    def matches?(times_called)
      times_called <= @times
    end

    def attempt?(times_called)
      times_called < @times
    end

    protected
    def expected_message_part
      "Expected at most #{@times.inspect} times."
    end
  end
end
end

Version data entries

7 entries across 7 versions & 1 rubygems

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