Sha256: d77d91e0173e48f842dbb623c0af2c5f7d2d9a13cff960ebc7fda4904e966e86

Contents?: true

Size: 1.5 KB

Versions: 71

Compression:

Stored size: 1.5 KB

Contents

module WebMock
  class WebMockMatcher

    def initialize(method, uri)
      @request_execution_verifier = RequestExecutionVerifier.new
      @request_execution_verifier.request_pattern = RequestPattern.new(method, uri)
    end

    def once
      @request_execution_verifier.expected_times_executed = 1
      self
    end

    def twice
      @request_execution_verifier.expected_times_executed = 2
      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
      self
    end

    def with(options = {}, &block)
      @request_execution_verifier.request_pattern.with(options, &block)
      self
    end

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

    def matches?(webmock)
      @request_execution_verifier.matches?
    end

    def does_not_match?(webmock)
      @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

71 entries across 71 versions & 5 rubygems

Version Path
fluent-plugin-google-cloud-logging-on-prem-0.1.0 vendor/ruby/3.1.0/gems/webmock-3.18.1/lib/webmock/rspec/matchers/webmock_matcher.rb
webmock-3.18.1 lib/webmock/rspec/matchers/webmock_matcher.rb
webmock-3.18.0 lib/webmock/rspec/matchers/webmock_matcher.rb
webmock-3.15.2 lib/webmock/rspec/matchers/webmock_matcher.rb
webmock-3.16.2 lib/webmock/rspec/matchers/webmock_matcher.rb
webmock-3.16.1 lib/webmock/rspec/matchers/webmock_matcher.rb
webmock-3.15.1 lib/webmock/rspec/matchers/webmock_matcher.rb
webmock-3.17.1 lib/webmock/rspec/matchers/webmock_matcher.rb
webmock-3.17.0 lib/webmock/rspec/matchers/webmock_matcher.rb
logstash-output-scalyr-0.2.1.beta vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/rspec/matchers/webmock_matcher.rb
logstash-output-scalyr-0.2.0 vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/rspec/matchers/webmock_matcher.rb
logstash-output-scalyr-0.2.0.beta vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/rspec/matchers/webmock_matcher.rb
logstash-output-scalyr-0.1.26.beta vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/rspec/matchers/webmock_matcher.rb
logstash-output-scalyr-0.1.25.beta vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/rspec/matchers/webmock_matcher.rb
logstash-output-scalyr-0.1.24.beta vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/rspec/matchers/webmock_matcher.rb
logstash-output-scalyr-0.1.23.beta vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/rspec/matchers/webmock_matcher.rb
logstash-output-scalyr-0.1.22.beta vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/rspec/matchers/webmock_matcher.rb
logstash-output-scalyr-0.1.21.beta vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/rspec/matchers/webmock_matcher.rb
logstash-output-scalyr-0.1.20.beta vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/rspec/matchers/webmock_matcher.rb
webmock-3.14.0 lib/webmock/rspec/matchers/webmock_matcher.rb