webmock 1.17.3 → 1.17.4
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +6 -0
- data/README.md +1 -0
- data/lib/webmock/api.rb +1 -1
- data/lib/webmock/request_execution_verifier.rb +1 -1
- data/lib/webmock/rspec/matchers/request_pattern_matcher.rb +5 -3
- data/lib/webmock/rspec/matchers/webmock_matcher.rb +5 -3
- data/lib/webmock/version.rb +1 -1
- data/spec/unit/request_execution_verifier_spec.rb +2 -2
- metadata +4 -4
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -881,6 +881,7 @@ People who submitted patches and new features or suggested improvements. Many th
|
|
881
881
|
* Praveen Arimbrathodiyil
|
882
882
|
* Bo Jeanes
|
883
883
|
* Matthew Conway
|
884
|
+
* Rob Olson
|
884
885
|
|
885
886
|
For a full list of contributors you can visit the
|
886
887
|
[contributors](https://github.com/bblimke/webmock/contributors) page.
|
data/lib/webmock/api.rb
CHANGED
@@ -71,7 +71,7 @@ module WebMock
|
|
71
71
|
|
72
72
|
def assert_request_not_requested(request, options = {})
|
73
73
|
verifier = WebMock::RequestExecutionVerifier.new(request, options.delete(:times))
|
74
|
-
WebMock::AssertionFailure.failure(verifier.
|
74
|
+
WebMock::AssertionFailure.failure(verifier.failure_message_when_negated) unless verifier.does_not_match?
|
75
75
|
end
|
76
76
|
|
77
77
|
#this is a based on RSpec::Mocks::ArgumentMatchers#anythingize_lonely_keys
|
@@ -32,7 +32,7 @@ module WebMock
|
|
32
32
|
text
|
33
33
|
end
|
34
34
|
|
35
|
-
def
|
35
|
+
def failure_message_when_negated
|
36
36
|
text = if @expected_times_executed
|
37
37
|
%Q(The request #{request_pattern.to_s} was not expected to execute #{times(expected_times_executed)} but it executed #{times(times_executed)})
|
38
38
|
else
|
@@ -34,9 +34,11 @@ module WebMock
|
|
34
34
|
@request_execution_verifier.failure_message
|
35
35
|
end
|
36
36
|
|
37
|
-
|
38
|
-
|
39
|
-
@request_execution_verifier.negative_failure_message
|
37
|
+
def failure_message_when_negated
|
38
|
+
@request_execution_verifier.failure_message_when_negated
|
40
39
|
end
|
40
|
+
|
41
|
+
# RSpec 2 compatibility:
|
42
|
+
alias_method :negative_failure_message, :failure_message_when_negated
|
41
43
|
end
|
42
44
|
end
|
@@ -38,9 +38,11 @@ module WebMock
|
|
38
38
|
@request_execution_verifier.failure_message
|
39
39
|
end
|
40
40
|
|
41
|
-
|
42
|
-
|
43
|
-
@request_execution_verifier.negative_failure_message
|
41
|
+
def failure_message_when_negated
|
42
|
+
@request_execution_verifier.failure_message_when_negated
|
44
43
|
end
|
44
|
+
|
45
|
+
# RSpec 2 compatibility:
|
46
|
+
alias_method :negative_failure_message, :failure_message_when_negated
|
45
47
|
end
|
46
48
|
end
|
data/lib/webmock/version.rb
CHANGED
@@ -37,14 +37,14 @@ describe WebMock::RequestExecutionVerifier do
|
|
37
37
|
@verifier.expected_times_executed = 2
|
38
38
|
expected_text = "The request www.example.com was not expected to execute 2 times but it executed 2 times"
|
39
39
|
expected_text << @executed_requests_info
|
40
|
-
@verifier.
|
40
|
+
@verifier.failure_message_when_negated.should == expected_text
|
41
41
|
end
|
42
42
|
|
43
43
|
it "should report failure message when not expected request but it executed" do
|
44
44
|
@verifier.times_executed = 1
|
45
45
|
expected_text = "The request www.example.com was expected to execute 0 times but it executed 1 time"
|
46
46
|
expected_text << @executed_requests_info
|
47
|
-
@verifier.
|
47
|
+
@verifier.failure_message_when_negated.should == expected_text
|
48
48
|
end
|
49
49
|
|
50
50
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: webmock
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 91
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 17
|
9
|
-
-
|
10
|
-
version: 1.17.
|
9
|
+
- 4
|
10
|
+
version: 1.17.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Bartosz Blimke
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2014-02
|
18
|
+
date: 2014-03-02 00:00:00 +01:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|