pact-support 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/pact/matching_rules/extract.rb +2 -0
- data/lib/pact/support/version.rb +1 -1
- data/spec/lib/pact/matching_rules/extract_spec.rb +36 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1250628a81126493c975c34bd21ac627275e578a
|
4
|
+
data.tar.gz: 9f7e7f2609e0cc1f0ec03917b0bb35c70e3f36c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 130b05570e62134204018f8cd5227ffa103b6e4b2d825464131c84e1a6dc24e7318768f3f9a2adc82a0a0cc3098901856390628aca30fd23a4db8283b02ae19c
|
7
|
+
data.tar.gz: 5a48f981de6dfbbab2d1c0f6f4844f73591c8a0558944593911f92c5d0f57973b5d1fd5905d6186d1ba02e5cd0e64b6856d29800252bf2bc98050df56db6ba46
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,9 @@ Do this to generate your change history
|
|
2
2
|
|
3
3
|
git log --pretty=format:' * %h - %s (%an, %ad)' vX.Y.Z..HEAD
|
4
4
|
|
5
|
+
### 1.0.1 (11 May 2017)
|
6
|
+
* e34374b - Extract rules for QueryHash and QueryString so we can include request matching rules in the pact. (Beth Skurrie, Thu May 11 09:11:19 2017 +1000)
|
7
|
+
|
5
8
|
### 1.0.0 (12 Apr 2017)
|
6
9
|
* 0ad2ef5 - Stop removing trailing slash from path, as per https://github.com/pact-foundation/pact-specification/blob/version-2/testcases/request/path/missing%20trailing%20slash%20in%20path.json (Beth Skurrie, Wed Apr 12 14:59:04 2017 +1000)
|
7
10
|
* 7f93c00 - add a helper to match a non iso861 datetime string (Courtney Braafhart, Thu Apr 6 12:18:53 2017 -0500)
|
@@ -31,6 +31,8 @@ module Pact
|
|
31
31
|
when Pact::SomethingLike then handle_something_like(object, path, match_type)
|
32
32
|
when Pact::ArrayLike then handle_array_like(object, path, match_type)
|
33
33
|
when Pact::Term then record_regex_rule object, path
|
34
|
+
when Pact::QueryString then recurse(object.query, path, match_type)
|
35
|
+
when Pact::QueryHash then recurse_hash(object.query, path, match_type)
|
34
36
|
else
|
35
37
|
record_match_type_rule path, match_type
|
36
38
|
end
|
data/lib/pact/support/version.rb
CHANGED
@@ -146,6 +146,42 @@ module Pact
|
|
146
146
|
end
|
147
147
|
end
|
148
148
|
|
149
|
+
context "with a Pact::QueryString containing a Pact::Term" do
|
150
|
+
let(:matchable) do
|
151
|
+
{
|
152
|
+
query: Pact::QueryString.new(Pact::Term.new(generate: 'foobar', matcher: /foo/))
|
153
|
+
}
|
154
|
+
end
|
155
|
+
|
156
|
+
let(:rules) do
|
157
|
+
{
|
158
|
+
"$.query" => {"match" => "regex", "regex" => "foo"}
|
159
|
+
}
|
160
|
+
end
|
161
|
+
|
162
|
+
it "lists a rule that specifies that the regular expression must match" do
|
163
|
+
expect(subject).to eq rules
|
164
|
+
end
|
165
|
+
end
|
166
|
+
|
167
|
+
context "with a Pact::QueryHash containing a Pact::Term" do
|
168
|
+
let(:matchable) do
|
169
|
+
{
|
170
|
+
query: Pact::QueryHash.new(bar: Pact::Term.new(generate: 'foobar', matcher: /foo/))
|
171
|
+
}
|
172
|
+
end
|
173
|
+
|
174
|
+
let(:rules) do
|
175
|
+
{
|
176
|
+
"$.query.bar[0]" => {"match" => "regex", "regex" => "foo"}
|
177
|
+
}
|
178
|
+
end
|
179
|
+
|
180
|
+
it "lists a rule that specifies that the regular expression must match" do
|
181
|
+
expect(subject).to eq rules
|
182
|
+
end
|
183
|
+
end
|
184
|
+
|
149
185
|
context "with no special matching" do
|
150
186
|
let(:matchable) do
|
151
187
|
{
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pact-support
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
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-05-10 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: randexp
|