pact 1.31.0 → 1.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/lib/pact/provider/rspec.rb +4 -3
- data/lib/pact/provider/rspec/pact_broker_formatter.rb +4 -0
- data/lib/pact/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 31e15b6e6c38268de6f34ce8666124734fda01d1
|
4
|
+
data.tar.gz: f8cbed9ab225aa39984bab1a4380577a4cbadc6d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 649d77730ab50b7ed08fcf381f86c1a025c8cd024bb9193709d5c7c7c3341c7395fb21f37bfae58ad961363d8afb005e043c69eae5800e98a3cdde62cd12b1f7
|
7
|
+
data.tar.gz: 2e8da320393e66e3e3487ce7249ea3a825d23c304f1ed213bfe1590ac834524319b7132261a69d698aeba6d7ca4be3b1cd1f9f34cd8f1085f07466531bbe35f9
|
data/CHANGELOG.md
CHANGED
data/lib/pact/provider/rspec.rb
CHANGED
@@ -110,20 +110,21 @@ module Pact
|
|
110
110
|
include Pact::RSpec::Matchers
|
111
111
|
extend Pact::Matchers::Messages
|
112
112
|
|
113
|
-
let(:
|
113
|
+
let(:expected_contents) { expected_response.body[:contents].as_json }
|
114
114
|
let(:response) { interaction_context.last_response }
|
115
115
|
let(:differ) { Pact.configuration.body_differ_for_content_type diff_content_type }
|
116
116
|
let(:diff_formatter) { Pact.configuration.diff_formatter_for_content_type diff_content_type }
|
117
117
|
let(:diff_options) { { with: differ, diff_formatter: diff_formatter } }
|
118
118
|
let(:diff_content_type) { 'application/json' }
|
119
119
|
let(:response_body) { parse_body_from_response(response) }
|
120
|
-
let(:
|
120
|
+
let(:actual_contents) { response_body['contents'] }
|
121
121
|
|
122
122
|
it "has matching content" do | example |
|
123
123
|
if response.status != 200
|
124
124
|
raise "An error was raised while verifying the message. The response body is: #{response.body}"
|
125
125
|
end
|
126
|
-
|
126
|
+
set_metadata(example, :pact_actual_contents, actual_contents)
|
127
|
+
expect(actual_contents).to match_term expected_contents, diff_options, example
|
127
128
|
end
|
128
129
|
end
|
129
130
|
|
@@ -59,6 +59,10 @@ module Pact
|
|
59
59
|
hash[:actualBody] = example.metadata[:pact_actual_body]
|
60
60
|
end
|
61
61
|
|
62
|
+
if example.metadata[:pact_actual_contents]
|
63
|
+
hash[:actualContents] = example.metadata[:pact_actual_contents]
|
64
|
+
end
|
65
|
+
|
62
66
|
if example.metadata[:pact_diff]
|
63
67
|
hash[:differences] = Pact::Matchers::ExtractDiffMessages.call(example.metadata[:pact_diff])
|
64
68
|
.to_a
|
data/lib/pact/version.rb
CHANGED