Class: WebMock::RequestPatternMatcher
- Inherits:
-
Object
- Object
- WebMock::RequestPatternMatcher
- Defined in:
- lib/webmock/rspec/matchers/request_pattern_matcher.rb
Instance Method Summary collapse
- #at_least_once ⇒ Object
- #at_least_times(times) ⇒ Object
- #at_least_twice ⇒ Object
- #at_most_once ⇒ Object
- #at_most_times(times) ⇒ Object
- #at_most_twice ⇒ Object
- #description ⇒ Object
- #does_not_match?(request_pattern) ⇒ Boolean
- #failure_message ⇒ Object
- #failure_message_when_negated ⇒ Object (also: #negative_failure_message)
-
#initialize ⇒ RequestPatternMatcher
constructor
A new instance of RequestPatternMatcher.
- #matches?(request_pattern) ⇒ Boolean
- #once ⇒ Object
- #times(times) ⇒ Object
- #twice ⇒ Object
Constructor Details
#initialize ⇒ RequestPatternMatcher
Returns a new instance of RequestPatternMatcher.
6 7 8 |
# File 'lib/webmock/rspec/matchers/request_pattern_matcher.rb', line 6 def initialize @request_execution_verifier = RequestExecutionVerifier.new end |
Instance Method Details
#at_least_once ⇒ Object
25 26 27 28 |
# File 'lib/webmock/rspec/matchers/request_pattern_matcher.rb', line 25 def at_least_once @request_execution_verifier.at_least_times_executed = 1 self end |
#at_least_times(times) ⇒ Object
35 36 37 38 |
# File 'lib/webmock/rspec/matchers/request_pattern_matcher.rb', line 35 def at_least_times(times) @request_execution_verifier.at_least_times_executed = times.to_i self end |
#at_least_twice ⇒ Object
30 31 32 33 |
# File 'lib/webmock/rspec/matchers/request_pattern_matcher.rb', line 30 def at_least_twice @request_execution_verifier.at_least_times_executed = 2 self end |
#at_most_once ⇒ Object
40 41 42 43 |
# File 'lib/webmock/rspec/matchers/request_pattern_matcher.rb', line 40 def at_most_once @request_execution_verifier.at_most_times_executed = 1 self end |
#at_most_times(times) ⇒ Object
50 51 52 53 |
# File 'lib/webmock/rspec/matchers/request_pattern_matcher.rb', line 50 def at_most_times(times) @request_execution_verifier.at_most_times_executed = times.to_i self end |
#at_most_twice ⇒ Object
45 46 47 48 |
# File 'lib/webmock/rspec/matchers/request_pattern_matcher.rb', line 45 def at_most_twice @request_execution_verifier.at_most_times_executed = 2 self end |
#description ⇒ Object
73 74 75 |
# File 'lib/webmock/rspec/matchers/request_pattern_matcher.rb', line 73 def description @request_execution_verifier.description end |
#does_not_match?(request_pattern) ⇒ Boolean
60 61 62 63 |
# File 'lib/webmock/rspec/matchers/request_pattern_matcher.rb', line 60 def does_not_match?(request_pattern) @request_execution_verifier.request_pattern = request_pattern @request_execution_verifier.does_not_match? end |
#failure_message ⇒ Object
65 66 67 |
# File 'lib/webmock/rspec/matchers/request_pattern_matcher.rb', line 65 def @request_execution_verifier. end |
#failure_message_when_negated ⇒ Object Also known as: negative_failure_message
69 70 71 |
# File 'lib/webmock/rspec/matchers/request_pattern_matcher.rb', line 69 def @request_execution_verifier. end |
#matches?(request_pattern) ⇒ Boolean
55 56 57 58 |
# File 'lib/webmock/rspec/matchers/request_pattern_matcher.rb', line 55 def matches?(request_pattern) @request_execution_verifier.request_pattern = request_pattern @request_execution_verifier.matches? end |
#once ⇒ Object
10 11 12 13 |
# File 'lib/webmock/rspec/matchers/request_pattern_matcher.rb', line 10 def once @request_execution_verifier.expected_times_executed = 1 self end |
#times(times) ⇒ Object
20 21 22 23 |
# File 'lib/webmock/rspec/matchers/request_pattern_matcher.rb', line 20 def times(times) @request_execution_verifier.expected_times_executed = times.to_i self end |
#twice ⇒ Object
15 16 17 18 |
# File 'lib/webmock/rspec/matchers/request_pattern_matcher.rb', line 15 def twice @request_execution_verifier.expected_times_executed = 2 self end |