Sha256: 0bbe6dc7accb7e28750ae7b986972705f3f44a48fdf6f071cae15c141f623e80

Contents?: true

Size: 1023 Bytes

Versions: 49

Compression:

Stored size: 1023 Bytes

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 negative_failure_message
      @request_execution_verifier.negative_failure_message
    end
  end
end

Version data entries

49 entries across 49 versions & 3 rubygems

Version Path
webmock-1.7.8 lib/webmock/rspec/matchers/webmock_matcher.rb
webmock-1.7.7 lib/webmock/rspec/matchers/webmock_matcher.rb
webmock-1.7.6 lib/webmock/rspec/matchers/webmock_matcher.rb
webmock-1.7.5 lib/webmock/rspec/matchers/webmock_matcher.rb
webmock-1.7.4 lib/webmock/rspec/matchers/webmock_matcher.rb
webmock-1.7.3 lib/webmock/rspec/matchers/webmock_matcher.rb
webmock-1.7.2 lib/webmock/rspec/matchers/webmock_matcher.rb
webmock-1.7.1 lib/webmock/rspec/matchers/webmock_matcher.rb
webmock-1.7.0 lib/webmock/rspec/matchers/webmock_matcher.rb