pact 1.15.0 → 1.16.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/pact/provider/matchers/messages.rb +21 -2
- data/lib/pact/provider/rspec.rb +5 -2
- data/lib/pact/version.rb +1 -1
- data/pact.gemspec +1 -1
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f12dd3c9ccdf082d1816783d7defa13ee9df47b
|
4
|
+
data.tar.gz: 0221ad15770f29536daea315b64f965579e9a4fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 68ca83ab0bfab86a947a582adee3b3583ef1fe429d372660f738e9c977be6987e80de122f5d8e93ef1b1159d40d186df8c26b9d67c7839f76d7d46e3d8633a8e
|
7
|
+
data.tar.gz: cc1ca09bcac2acee98480ef4b92237328686eb8a6e73f8d868f168ea29842155979871f244287c5a0d56785c936dacb2051418b95736d592a5e7ca5beaf6a28a
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,10 @@ Do this to generate your change history
|
|
2
2
|
|
3
3
|
git log --pretty=format:' * %h - %s (%an, %ad)'
|
4
4
|
|
5
|
+
## 1.16.0 (25 September 2017)
|
6
|
+
* 70e67cf - feat: improve description of rspec header matching 'it' blocks and failure text (Beth Skurrie, Mon Sep 25 08:46:06 2017 +1000)
|
7
|
+
* 85d8e09 - fix: correctly display pact term when parent key is missing (Beth Skurrie, Mon Sep 25 08:43:02 2017 +1000)
|
8
|
+
|
5
9
|
## 1.15.0 (11 August 2017)
|
6
10
|
* a950a16 - fix: Fix module declaration (Beth Skurrie, Fri Aug 11 11:47:46 2017 +1000)
|
7
11
|
* 14cd969 - feat(output): Remove ruby specific text from pact verification output. (Beth Skurrie, Tue Aug 8 17:12:50 2017 +1000)
|
@@ -19,6 +19,20 @@ module Pact
|
|
19
19
|
"Expected header \"#{header_name}\" to #{expected_desc(expected)}, but was #{actual_desc(actual)}"
|
20
20
|
end
|
21
21
|
|
22
|
+
def expected_desc_for_it expected
|
23
|
+
case expected
|
24
|
+
when NilClass then "is nil"
|
25
|
+
when Regexp
|
26
|
+
"matches #{expected.inspect}"
|
27
|
+
when Pact::Term
|
28
|
+
"matches #{expected.matcher.inspect}"
|
29
|
+
when Pact::SomethingLike
|
30
|
+
"is an instance of #{Pact::Reification.from_term(expected).class}"
|
31
|
+
else
|
32
|
+
"equals #{expected.inspect}"
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
22
36
|
private
|
23
37
|
|
24
38
|
def colorize_if_enabled formatted_diff, color_enabled
|
@@ -35,15 +49,20 @@ module Pact
|
|
35
49
|
def expected_desc expected
|
36
50
|
case expected
|
37
51
|
when NilClass then "be nil"
|
38
|
-
|
52
|
+
when Regexp
|
39
53
|
"match #{expected.inspect}"
|
54
|
+
when Pact::Term
|
55
|
+
"match #{expected.matcher.inspect}"
|
56
|
+
when Pact::SomethingLike
|
57
|
+
"be an instance of #{Pact::Reification.from_term(expected).class}"
|
58
|
+
else
|
59
|
+
"equal #{expected.inspect}"
|
40
60
|
end
|
41
61
|
end
|
42
62
|
|
43
63
|
def actual_desc actual
|
44
64
|
actual.nil? ? 'nil' : '"' + actual + '"'
|
45
65
|
end
|
46
|
-
|
47
66
|
end
|
48
67
|
end
|
49
68
|
end
|
data/lib/pact/provider/rspec.rb
CHANGED
@@ -3,6 +3,8 @@ require 'pact/consumer_contract'
|
|
3
3
|
require 'pact/provider/rspec/matchers'
|
4
4
|
require 'pact/provider/test_methods'
|
5
5
|
require 'pact/provider/configuration'
|
6
|
+
require 'pact/provider/matchers/messages'
|
7
|
+
|
6
8
|
|
7
9
|
module Pact
|
8
10
|
module Provider
|
@@ -90,7 +92,7 @@ module Pact
|
|
90
92
|
end
|
91
93
|
end
|
92
94
|
|
93
|
-
describe_response Pact::Response.new(
|
95
|
+
describe_response Pact::Response.new(interaction.response), interaction_context
|
94
96
|
|
95
97
|
end
|
96
98
|
|
@@ -103,6 +105,7 @@ module Pact
|
|
103
105
|
describe "returns a response which" do
|
104
106
|
|
105
107
|
include Pact::RSpec::Matchers
|
108
|
+
extend Pact::Matchers::Messages
|
106
109
|
|
107
110
|
let(:expected_response_status) { expected_response.status }
|
108
111
|
let(:expected_response_body) { expected_response.body }
|
@@ -125,7 +128,7 @@ module Pact
|
|
125
128
|
if expected_response.headers
|
126
129
|
describe "includes headers" do
|
127
130
|
expected_response.headers.each do |name, expected_header_value|
|
128
|
-
it "\"#{name}\"
|
131
|
+
it "\"#{name}\" which #{expected_desc_for_it(expected_header_value)}" do
|
129
132
|
header_value = response.headers[name]
|
130
133
|
expect(header_value).to match_header(name, expected_header_value)
|
131
134
|
end
|
data/lib/pact/version.rb
CHANGED
data/pact.gemspec
CHANGED
@@ -28,7 +28,7 @@ Gem::Specification.new do |gem|
|
|
28
28
|
gem.add_runtime_dependency 'webrick'
|
29
29
|
gem.add_runtime_dependency 'term-ansicolor', '~> 1.0'
|
30
30
|
|
31
|
-
gem.add_runtime_dependency 'pact-support', '~> 1.1'
|
31
|
+
gem.add_runtime_dependency 'pact-support', '~> 1.1', '>=1.1.8'
|
32
32
|
gem.add_runtime_dependency 'pact-mock_service', '~> 2.0'
|
33
33
|
|
34
34
|
gem.add_development_dependency 'rake', '~> 10.0.3'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pact
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.16.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Fraser
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2017-
|
15
|
+
date: 2017-09-25 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: randexp
|
@@ -119,6 +119,9 @@ dependencies:
|
|
119
119
|
- - "~>"
|
120
120
|
- !ruby/object:Gem::Version
|
121
121
|
version: '1.1'
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: 1.1.8
|
122
125
|
type: :runtime
|
123
126
|
prerelease: false
|
124
127
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -126,6 +129,9 @@ dependencies:
|
|
126
129
|
- - "~>"
|
127
130
|
- !ruby/object:Gem::Version
|
128
131
|
version: '1.1'
|
132
|
+
- - ">="
|
133
|
+
- !ruby/object:Gem::Version
|
134
|
+
version: 1.1.8
|
129
135
|
- !ruby/object:Gem::Dependency
|
130
136
|
name: pact-mock_service
|
131
137
|
requirement: !ruby/object:Gem::Requirement
|