pact-support 1.1.1 → 1.1.2
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/consumer_contract/query_hash.rb +2 -3
- data/lib/pact/consumer_contract/request.rb +4 -2
- data/lib/pact/matchers/matchers.rb +5 -4
- data/lib/pact/reification.rb +7 -1
- data/lib/pact/shared/request.rb +0 -2
- data/lib/pact/support/version.rb +1 -1
- data/spec/lib/pact/reification_spec.rb +2 -0
- 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: 28fb09a1b1f000cce4b9a16ea20d26400ff8fa0a
|
4
|
+
data.tar.gz: 87433656e306d9ca818b0ea56ecab7c79fe5ec4c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f0ced826a85541d5cd4ac8ad6aa5cf014e76f063b44b21282a1efe9730412575f48e1f35d2853ef950dad374671e72c9a11df4e24a3baeda2fcdae81f7151ca
|
7
|
+
data.tar.gz: ec80f3ad890c6345a6637ac40732fbf8c8d5103d5724eca9bbfca77d36ebb372c51ddf349f2a63a415bffff7a9b7c76be2d9aed87fbd6c05eec87196b226305d
|
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)'
|
4
4
|
|
5
|
+
### 1.1.2 (20 June 2017)
|
6
|
+
* 8c3e53d - Fixing recursive require problems for https://github.com/pact-foundation/pact-support/issues/36 (Beth Skurrie, Tue Jun 20 18:59:24 2017 +1000)
|
7
|
+
|
5
8
|
### 1.1.1 (20 June 2017)
|
6
9
|
* 14789df - Adding missing requires for #36 (Beth Skurrie, Tue Jun 20 16:27:43 2017 +1000)
|
7
10
|
|
@@ -1,13 +1,11 @@
|
|
1
1
|
require 'cgi'
|
2
2
|
require 'pact/shared/active_support_support'
|
3
|
-
require 'pact/matchers'
|
4
3
|
require 'pact/symbolize_keys'
|
5
4
|
|
6
5
|
module Pact
|
7
6
|
class QueryHash
|
8
7
|
|
9
8
|
include ActiveSupportSupport
|
10
|
-
include Pact::Matchers
|
11
9
|
include SymbolizeKeys
|
12
10
|
|
13
11
|
def initialize(query)
|
@@ -33,7 +31,8 @@ module Pact
|
|
33
31
|
# other will always be a QueryString, not a QueryHash, as it will have ben created
|
34
32
|
# from the actual query string.
|
35
33
|
def difference(other)
|
36
|
-
|
34
|
+
require 'pact/matchers' # avoid recursive loop between this file, pact/reification and pact/matchers
|
35
|
+
Pact::Matchers.diff(query, symbolize_keys(CGI::parse(other.query)), allow_unexpected_keys: false)
|
37
36
|
end
|
38
37
|
|
39
38
|
def query
|
@@ -31,13 +31,15 @@ module Pact
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def matches_route? actual_request
|
34
|
+
require 'pact/matchers' # avoid recusive loop between pact/reification, pact/matchers and this file
|
34
35
|
route = {:method => method.upcase, :path => path}
|
35
36
|
other_route = {:method => actual_request.method.upcase, :path => actual_request.path}
|
36
|
-
diff(route, other_route).empty?
|
37
|
+
Pact::Matchers.diff(route, other_route).empty?
|
37
38
|
end
|
38
39
|
|
39
40
|
def difference(actual_request)
|
40
|
-
|
41
|
+
require 'pact/matchers' # avoid recusive loop between pact/reification, pact/matchers and this file
|
42
|
+
request_diff = Pact::Matchers.diff(to_hash_without_body_or_query, actual_request.to_hash_without_body_or_query)
|
41
43
|
request_diff.merge!(query_diff(actual_request.query))
|
42
44
|
request_diff.merge!(body_diff(actual_request.body))
|
43
45
|
end
|
@@ -1,9 +1,8 @@
|
|
1
1
|
require 'pact/term'
|
2
2
|
require 'pact/something_like'
|
3
|
-
require 'pact/
|
3
|
+
require 'pact/array_like'
|
4
4
|
require 'pact/shared/null_expectation'
|
5
5
|
require 'pact/shared/key_not_found'
|
6
|
-
require 'pact/shared/request' # Not sure why this is needed, possibly something downstream https://github.com/pact-foundation/pact-support/issues/36
|
7
6
|
require 'pact/matchers/unexpected_key'
|
8
7
|
require 'pact/matchers/unexpected_index'
|
9
8
|
require 'pact/matchers/index_not_found'
|
@@ -13,11 +12,11 @@ require 'pact/matchers/type_difference'
|
|
13
12
|
require 'pact/matchers/expected_type'
|
14
13
|
require 'pact/matchers/actual_type'
|
15
14
|
require 'pact/matchers/no_diff_at_index'
|
16
|
-
require 'pact/
|
15
|
+
require 'pact/reification'
|
17
16
|
|
18
17
|
module Pact
|
19
18
|
# Should be called Differs
|
20
|
-
# Note to self: Some people
|
19
|
+
# Note to self: Some people are using this module directly, so if you refactor it
|
21
20
|
# maintain backwards compatibility
|
22
21
|
|
23
22
|
module Matchers
|
@@ -26,6 +25,8 @@ module Pact
|
|
26
25
|
DEFAULT_OPTIONS = {allow_unexpected_keys: true, type: false}.freeze
|
27
26
|
NO_DIFF = {}.freeze
|
28
27
|
|
28
|
+
extend self
|
29
|
+
|
29
30
|
def diff expected, actual, opts = {}
|
30
31
|
calculate_diff(expected, actual, DEFAULT_OPTIONS.merge(opts))
|
31
32
|
end
|
data/lib/pact/reification.rb
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
require 'randexp'
|
2
2
|
require 'rack/utils'
|
3
|
-
|
3
|
+
require 'pact/term'
|
4
|
+
require 'pact/something_like'
|
5
|
+
require 'pact/array_like'
|
6
|
+
require 'pact/shared/request'
|
7
|
+
require 'pact/consumer_contract/query_hash'
|
8
|
+
require 'pact/consumer_contract/query_string'
|
9
|
+
|
4
10
|
module Pact
|
5
11
|
module Reification
|
6
12
|
include ActiveSupportSupport
|
data/lib/pact/shared/request.rb
CHANGED
data/lib/pact/support/version.rb
CHANGED