Sha256: 80c858da532c90f80a1dbd2f149a1ff0a28b3f60962573c526675f8c4565fd55

Contents?: true

Size: 1.18 KB

Versions: 118

Compression:

Stored size: 1.18 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 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

118 entries across 109 versions & 8 rubygems

Version Path
vagrant-unbundled-2.2.5.0 vendor/bundle/ruby/2.5.0/gems/webmock-2.3.2/lib/webmock/rspec/matchers/webmock_matcher.rb
dadapush_client-1.0.1 vendor/bundle/ruby/2.3.0/gems/webmock-1.24.6/lib/webmock/rspec/matchers/webmock_matcher.rb
vagrant-unbundled-2.2.4.0 vendor/bundle/ruby/2.6.0/gems/webmock-2.3.2/lib/webmock/rspec/matchers/webmock_matcher.rb
vagrant-unbundled-2.2.4.0 vendor/bundle/ruby/2.5.0/gems/webmock-2.3.2/lib/webmock/rspec/matchers/webmock_matcher.rb
vagrant-unbundled-2.2.3.0 vendor/bundle/ruby/2.5.0/gems/webmock-2.3.2/lib/webmock/rspec/matchers/webmock_matcher.rb
vagrant-unbundled-2.2.2.0 vendor/bundle/ruby/2.5.0/gems/webmock-2.3.2/lib/webmock/rspec/matchers/webmock_matcher.rb
vagrant-unbundled-2.2.0.0 vendor/bundle/ruby/2.5.0/gems/webmock-2.3.2/lib/webmock/rspec/matchers/webmock_matcher.rb
vagrant-unbundled-2.1.4.0 vendor/bundle/ruby/2.5.0/gems/webmock-2.3.2/lib/webmock/rspec/matchers/webmock_matcher.rb
vagrant-unbundled-2.1.2.0 vendor/bundle/ruby/2.3.0/gems/webmock-2.3.2/lib/webmock/rspec/matchers/webmock_matcher.rb
cloudsmith-api-0.30.7 vendor/bundle/ruby/2.3.0/gems/webmock-1.24.6/lib/webmock/rspec/matchers/webmock_matcher.rb
color_me_shop-1.0.0 vendor/bundle/ruby/2.5.0/gems/webmock-1.24.6/lib/webmock/rspec/matchers/webmock_matcher.rb
vagrant-unbundled-2.1.1.0 vendor/bundle/ruby/2.5.0/gems/webmock-2.3.2/lib/webmock/rspec/matchers/webmock_matcher.rb
vagrant-unbundled-2.0.4.0 vendor/bundle/ruby/2.5.0/gems/webmock-2.3.2/lib/webmock/rspec/matchers/webmock_matcher.rb
vagrant-unbundled-2.0.3.0 vendor/bundle/ruby/2.5.0/gems/webmock-2.3.2/lib/webmock/rspec/matchers/webmock_matcher.rb
vagrant-unbundled-2.0.2.0 vendor/bundle/ruby/2.5.0/gems/webmock-2.3.2/lib/webmock/rspec/matchers/webmock_matcher.rb
vagrant-unbundled-2.0.2.0 vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/lib/webmock/rspec/matchers/webmock_matcher.rb
vagrant-unbundled-2.0.2.0 vendor/bundle/ruby/2.4.0/gems/webmock-1.24.6/lib/webmock/rspec/matchers/webmock_matcher.rb
vagrant-unbundled-2.0.1.0 vendor/bundle/ruby/2.4.0/gems/webmock-2.3.2/lib/webmock/rspec/matchers/webmock_matcher.rb
vagrant-unbundled-2.0.1.0 vendor/bundle/ruby/2.4.0/gems/webmock-1.24.6/lib/webmock/rspec/matchers/webmock_matcher.rb
cloudsmith-api-0.21.4 vendor/bundle/ruby/2.3.0/gems/webmock-1.24.6/lib/webmock/rspec/matchers/webmock_matcher.rb