pact-support 1.1.1 → 1.1.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 95820adaa595dc1673aab77ebb97494ddb08bc48
4
- data.tar.gz: 7cf2419270f7d417f378648dda47cff9c11f16cd
3
+ metadata.gz: 28fb09a1b1f000cce4b9a16ea20d26400ff8fa0a
4
+ data.tar.gz: 87433656e306d9ca818b0ea56ecab7c79fe5ec4c
5
5
  SHA512:
6
- metadata.gz: b585de5fde5541e24230fc6a52f3e2c4f3bcb0d84299488f5b3092f6cc513309e93129443b22a1a71825f0618a6da7de174637b8b7087e22f59a043ae53c1d0f
7
- data.tar.gz: 9e7ae773b68f2905478b270660c4a3bb1759bca55074d340b8ef8aebb5057a5cf715b908ba3e6dec59860ef50789490ce073076dbe3c24bc23414f3f3e305064
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
- diff(query, symbolize_keys(CGI::parse(other.query)), allow_unexpected_keys: false)
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
- request_diff = diff(to_hash_without_body_or_query, actual_request.to_hash_without_body_or_query)
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/reification'
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/array_like'
15
+ require 'pact/reification'
17
16
 
18
17
  module Pact
19
18
  # Should be called Differs
20
- # Note to self: Some people (Mike Williams) are using this module directly, so if you refactor it
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
@@ -1,6 +1,12 @@
1
1
  require 'randexp'
2
2
  require 'rack/utils'
3
- # reqiore 'active_support/core_ext/object/to_param'
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
@@ -8,9 +8,7 @@ module Pact
8
8
  module Request
9
9
 
10
10
  class Base
11
- include Pact::Matchers
12
11
  include Pact::SymbolizeKeys
13
- extend Pact::Matchers
14
12
 
15
13
  attr_reader :method, :path, :headers, :body, :query, :options
16
14
 
@@ -1,5 +1,5 @@
1
1
  module Pact
2
2
  module Support
3
- VERSION = "1.1.1"
3
+ VERSION = "1.1.2"
4
4
  end
5
5
  end
@@ -1,4 +1,6 @@
1
1
  require 'spec_helper'
2
+ require 'pact/reification'
3
+ require 'pact/consumer_contract/request'
2
4
 
3
5
  module Pact
4
6
  describe Reification do
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.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Fraser