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.
4 5 6 |
# File 'lib/webmock/rspec/matchers/request_pattern_matcher.rb', line 4 def initialize @request_execution_verifier = RequestExecutionVerifier.new end |
Instance Method Details
#at_least_once ⇒ Object
23 24 25 26 |
# File 'lib/webmock/rspec/matchers/request_pattern_matcher.rb', line 23 def at_least_once @request_execution_verifier.at_least_times_executed = 1 self end |
#at_least_times(times) ⇒ Object
33 34 35 36 |
# File 'lib/webmock/rspec/matchers/request_pattern_matcher.rb', line 33 def at_least_times(times) @request_execution_verifier.at_least_times_executed = times.to_i self end |
#at_least_twice ⇒ Object
28 29 30 31 |
# File 'lib/webmock/rspec/matchers/request_pattern_matcher.rb', line 28 def at_least_twice @request_execution_verifier.at_least_times_executed = 2 self end |
#at_most_once ⇒ Object
38 39 40 41 |
# File 'lib/webmock/rspec/matchers/request_pattern_matcher.rb', line 38 def at_most_once @request_execution_verifier.at_most_times_executed = 1 self end |
#at_most_times(times) ⇒ Object
48 49 50 51 |
# File 'lib/webmock/rspec/matchers/request_pattern_matcher.rb', line 48 def at_most_times(times) @request_execution_verifier.at_most_times_executed = times.to_i self end |
#at_most_twice ⇒ Object
43 44 45 46 |
# File 'lib/webmock/rspec/matchers/request_pattern_matcher.rb', line 43 def at_most_twice @request_execution_verifier.at_most_times_executed = 2 self end |
#description ⇒ Object
71 72 73 |
# File 'lib/webmock/rspec/matchers/request_pattern_matcher.rb', line 71 def description @request_execution_verifier.description end |
#does_not_match?(request_pattern) ⇒ Boolean
58 59 60 61 |
# File 'lib/webmock/rspec/matchers/request_pattern_matcher.rb', line 58 def does_not_match?(request_pattern) @request_execution_verifier.request_pattern = request_pattern @request_execution_verifier.does_not_match? end |
#failure_message ⇒ Object
63 64 65 |
# File 'lib/webmock/rspec/matchers/request_pattern_matcher.rb', line 63 def @request_execution_verifier. end |
#failure_message_when_negated ⇒ Object Also known as: negative_failure_message
67 68 69 |
# File 'lib/webmock/rspec/matchers/request_pattern_matcher.rb', line 67 def @request_execution_verifier. end |
#matches?(request_pattern) ⇒ Boolean
53 54 55 56 |
# File 'lib/webmock/rspec/matchers/request_pattern_matcher.rb', line 53 def matches?(request_pattern) @request_execution_verifier.request_pattern = request_pattern @request_execution_verifier.matches? end |
#once ⇒ Object
8 9 10 11 |
# File 'lib/webmock/rspec/matchers/request_pattern_matcher.rb', line 8 def once @request_execution_verifier.expected_times_executed = 1 self end |
#times(times) ⇒ Object
18 19 20 21 |
# File 'lib/webmock/rspec/matchers/request_pattern_matcher.rb', line 18 def times(times) @request_execution_verifier.expected_times_executed = times.to_i self end |
#twice ⇒ Object
13 14 15 16 |
# File 'lib/webmock/rspec/matchers/request_pattern_matcher.rb', line 13 def twice @request_execution_verifier.expected_times_executed = 2 self end |