Sha256: ebd89bd0af9447e70e3d6d2c5ced894ae3c5bb4849cabe059a1d6139f57d1452

Contents?: true

Size: 1.76 KB

Versions: 190

Compression:

Stored size: 1.76 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 at_least_once
      @request_execution_verifier.at_least_times_executed = 1
      self
    end

    def at_least_twice
      @request_execution_verifier.at_least_times_executed = 2
      self
    end

    def at_least_times(times)
      @request_execution_verifier.at_least_times_executed = times.to_i
      self
    end

    def at_most_once
      @request_execution_verifier.at_most_times_executed = 1
      self
    end

    def at_most_twice
      @request_execution_verifier.at_most_times_executed = 2
      self
    end

    def at_most_times(times)
      @request_execution_verifier.at_most_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

    def description
      @request_execution_verifier.description
    end

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

Version data entries

190 entries across 181 versions & 13 rubygems

Version Path
docspring-3.0.0 vendor/bundle/ruby/3.3.0/gems/webmock-1.24.6/lib/webmock/rspec/matchers/request_pattern_matcher.rb
cloudsmith-api-2.0.16 vendor/bundle/ruby/2.6.0/gems/webmock-1.24.6/lib/webmock/rspec/matchers/request_pattern_matcher.rb
cloudsmith-api-2.0.15 vendor/bundle/ruby/2.6.0/gems/webmock-1.24.6/lib/webmock/rspec/matchers/request_pattern_matcher.rb
cloudsmith-api-2.0.14 vendor/bundle/ruby/2.6.0/gems/webmock-1.24.6/lib/webmock/rspec/matchers/request_pattern_matcher.rb
cloudsmith-api-2.0.13 vendor/bundle/ruby/2.6.0/gems/webmock-1.24.6/lib/webmock/rspec/matchers/request_pattern_matcher.rb
cloudsmith-api-2.0.12 vendor/bundle/ruby/2.6.0/gems/webmock-1.24.6/lib/webmock/rspec/matchers/request_pattern_matcher.rb
cloudsmith-api-2.0.11 vendor/bundle/ruby/2.6.0/gems/webmock-1.24.6/lib/webmock/rspec/matchers/request_pattern_matcher.rb
cloudsmith-api-2.0.10 vendor/bundle/ruby/2.6.0/gems/webmock-1.24.6/lib/webmock/rspec/matchers/request_pattern_matcher.rb
cloudsmith-api-2.0.9 vendor/bundle/ruby/2.6.0/gems/webmock-1.24.6/lib/webmock/rspec/matchers/request_pattern_matcher.rb
cloudsmith-api-2.0.8 vendor/bundle/ruby/2.6.0/gems/webmock-1.24.6/lib/webmock/rspec/matchers/request_pattern_matcher.rb
cloudsmith-api-2.0.7 vendor/bundle/ruby/2.6.0/gems/webmock-1.24.6/lib/webmock/rspec/matchers/request_pattern_matcher.rb
cloudsmith-api-2.0.6 vendor/bundle/ruby/2.6.0/gems/webmock-1.24.6/lib/webmock/rspec/matchers/request_pattern_matcher.rb
cloudsmith-api-2.0.5 vendor/bundle/ruby/2.6.0/gems/webmock-1.24.6/lib/webmock/rspec/matchers/request_pattern_matcher.rb
cloudsmith-api-2.0.4 vendor/bundle/ruby/2.6.0/gems/webmock-1.24.6/lib/webmock/rspec/matchers/request_pattern_matcher.rb
cloudsmith-api-2.0.3 vendor/bundle/ruby/2.6.0/gems/webmock-1.24.6/lib/webmock/rspec/matchers/request_pattern_matcher.rb
cloudsmith-api-2.0.2 vendor/bundle/ruby/2.6.0/gems/webmock-1.24.6/lib/webmock/rspec/matchers/request_pattern_matcher.rb
fluent-plugin-google-cloud-logging-on-prem-0.1.0 vendor/ruby/3.1.0/gems/webmock-3.18.1/lib/webmock/rspec/matchers/request_pattern_matcher.rb
cloudsmith-api-2.0.1 vendor/bundle/ruby/2.6.0/gems/webmock-1.24.6/lib/webmock/rspec/matchers/request_pattern_matcher.rb
cloudsmith-api-2.0.0 vendor/bundle/ruby/2.6.0/gems/webmock-1.24.6/lib/webmock/rspec/matchers/request_pattern_matcher.rb
cloudsmith-api-1.142.3 vendor/bundle/ruby/2.6.0/gems/webmock-1.24.6/lib/webmock/rspec/matchers/request_pattern_matcher.rb