Sha256: 15c04a19bd9b34dfb4163b27ffdfa1ba5a6ddf844e6758a9d4f395f169565b4c

Contents?: true

Size: 1.11 KB

Versions: 16

Compression:

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

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

Version data entries

16 entries across 14 versions & 4 rubygems

Version Path
logstash-filter-zabbix-0.1.2 vendor/bundle/jruby/1.9/gems/webmock-1.21.0/lib/webmock/rspec/matchers/webmock_matcher.rb
logstash-filter-zabbix-0.1.1 vendor/bundle/jruby/1.9/gems/webmock-1.21.0/lib/webmock/rspec/matchers/webmock_matcher.rb
honeybadger-2.4.0 vendor/gems/ruby/1.9.1/gems/webmock-1.20.4/lib/webmock/rspec/matchers/webmock_matcher.rb
honeybadger-2.4.0 vendor/gems/ruby/2.2.0/gems/webmock-1.20.4/lib/webmock/rspec/matchers/webmock_matcher.rb
honeybadger-2.4.0 vendor/gems/ruby/2.1.0/gems/webmock-1.20.4/lib/webmock/rspec/matchers/webmock_matcher.rb
webmock-1.21.0 lib/webmock/rspec/matchers/webmock_matcher.rb
webmock-1.20.4 lib/webmock/rspec/matchers/webmock_matcher.rb
webmock-1.20.3 lib/webmock/rspec/matchers/webmock_matcher.rb
webmock-1.20.2 lib/webmock/rspec/matchers/webmock_matcher.rb
webmock-1.20.1 lib/webmock/rspec/matchers/webmock_matcher.rb
webmock-1.20.0 lib/webmock/rspec/matchers/webmock_matcher.rb
webmock-1.19.0 lib/webmock/rspec/matchers/webmock_matcher.rb
whos_dated_who-0.1.0 vendor/bundle/gems/webmock-1.18.0/lib/webmock/rspec/matchers/webmock_matcher.rb
whos_dated_who-0.0.1 vendor/bundle/gems/webmock-1.18.0/lib/webmock/rspec/matchers/webmock_matcher.rb
webmock-1.18.0 lib/webmock/rspec/matchers/webmock_matcher.rb
webmock-1.17.4 lib/webmock/rspec/matchers/webmock_matcher.rb