Sha256: 6bbcaf139f7d2cbe060af769070988f16d79fd722a872d433ae3ed09b9295407

Contents?: true

Size: 1.04 KB

Versions: 5

Compression:

Stored size: 1.04 KB

Contents

module WebMock
  class RequestPatternMatcher

    def initialize
      @request_execution_verifier = RequestExecutionVerifier.new
    end

    def once
      @request_execution_verifier.expected_times_executed = 1
      self
    end

    def twice
      @request_execution_verifier.expected_times_executed = 2
      self
    end

    def times(times)
      @request_execution_verifier.expected_times_executed = times.to_i
      self
    end

    def matches?(request_pattern)
      @request_execution_verifier.request_pattern = request_pattern
      @request_execution_verifier.matches?
    end

    def does_not_match?(request_pattern)
      @request_execution_verifier.request_pattern = request_pattern
      @request_execution_verifier.does_not_match?
    end

    def failure_message
      @request_execution_verifier.failure_message
    end

    def failure_message_when_negated
      @request_execution_verifier.failure_message_when_negated
    end

    # RSpec 2 compatibility:
    alias_method :negative_failure_message, :failure_message_when_negated
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
webmock-1.19.0 lib/webmock/rspec/matchers/request_pattern_matcher.rb
whos_dated_who-0.1.0 vendor/bundle/gems/webmock-1.18.0/lib/webmock/rspec/matchers/request_pattern_matcher.rb
whos_dated_who-0.0.1 vendor/bundle/gems/webmock-1.18.0/lib/webmock/rspec/matchers/request_pattern_matcher.rb
webmock-1.18.0 lib/webmock/rspec/matchers/request_pattern_matcher.rb
webmock-1.17.4 lib/webmock/rspec/matchers/request_pattern_matcher.rb