pact-mock_service 2.9.3 → 2.9.8

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
  SHA256:
3
- metadata.gz: 3678c2fe0959a9567c682abda102a67bc64e9825c863fe8e45c20feaa087e4c9
4
- data.tar.gz: 7cb612c9f10659a307f4091debc428d20f181782418f144ffacab52cc71f5eee
3
+ metadata.gz: 0ef699a1acd0281dbff4a1aea2cc7410ccd74255cd6ee2fd1bddd9b75f4ca446
4
+ data.tar.gz: b6a3d4981061358f1d1822511d25d34065cacca786dd8fbfe55aa8feab656f3c
5
5
  SHA512:
6
- metadata.gz: dec05f46f65c459f6d0ec67e23c5554a15e9363ade4fbe6e91c146ec55a530be519df1be4b872921ade52efce1f5dcaa72a63c4fbe83ce2c917c090d43de0250
7
- data.tar.gz: 1556979fb5e6a19cd65e0feaadb2e142c1c87522baf94fb25f9379de6fc5ae7ba6bb56d702317a42cb12ae487d478f5474e46079bacbb5ad3d4d3ef5a8f10b31
6
+ metadata.gz: a3b9f6bb39910a4530cfd07ac4f5aeb2c6952eb4c4fd1baed82da64e503b5a0e7fdfe07f803b03f227721ffb0a20710264708333be154be902bc1223de68b9f7
7
+ data.tar.gz: 5c1ea2f62ba55dde377650a986779ea925cd5c82cdb1aa136e6dea99cc6e26bcb80ab6c787c86975fcf488d3458b347a8c1f990c1cbf92cc043df47b9b4f2a9b
data/CHANGELOG.md CHANGED
@@ -1,3 +1,31 @@
1
+ <a name="v2.9.8"></a>
2
+ ### v2.9.8 (2018-07-23)
3
+
4
+
5
+ #### Bug Fixes
6
+
7
+ * require pact_specification_version when spawning mock service through app manager ([efdba96](/../../commit/efdba96))
8
+
9
+
10
+ <a name="v2.9.6"></a>
11
+ ### v2.9.6 (2018-07-23)
12
+
13
+
14
+ #### Bug Fixes
15
+
16
+ * use dummy pact specification version for stub server ([3337f6d](/../../commit/3337f6d))
17
+ * pass the pact specification version from the control server to the mock server ([b585092](/../../commit/b585092))
18
+
19
+
20
+ <a name="v2.9.4"></a>
21
+ ### v2.9.4 (2018-07-23)
22
+
23
+
24
+ #### Bug Fixes
25
+
26
+ * parse expected interactions with configured pact specification version ([1b960bf](/../../commit/1b960bf))
27
+
28
+
1
29
  <a name="v2.9.3"></a>
2
30
  ### v2.9.3 (2018-07-13)
3
31
 
@@ -30,7 +30,7 @@ module Pact
30
30
  name: name,
31
31
  log_file: create_log_file(name),
32
32
  pact_dir: pact_dir,
33
- pact_specification_version: options[:pact_specification_version]
33
+ pact_specification_version: options.fetch(:pact_specification_version)
34
34
  )
35
35
  register(app, uri.port)
36
36
  end
@@ -54,7 +54,8 @@ module Pact
54
54
  pact_dir: options[:pact_dir] || ".",
55
55
  unique_pact_file_names: options[:unique_pact_file_names],
56
56
  cors_enabled: options[:cors] || false,
57
- ssl: options[:ssl]
57
+ ssl: options[:ssl],
58
+ pact_specification_version: options[:pact_specification_version]
58
59
  }
59
60
  end
60
61
 
@@ -27,8 +27,8 @@ module Pact
27
27
  SessionDelete.new(name, logger, session),
28
28
  MissingInteractionsGet.new(name, logger, session),
29
29
  VerificationGet.new(name, logger, session),
30
- InteractionPost.new(name, logger, session),
31
- InteractionsPut.new(name, logger, session),
30
+ InteractionPost.new(name, logger, session, Pact::SpecificationVersion.new(options.fetch(:pact_specification_version))),
31
+ InteractionsPut.new(name, logger, session, Pact::SpecificationVersion.new(options.fetch(:pact_specification_version))),
32
32
  InteractionDelete.new(name, logger, session),
33
33
  LogGet.new(name, logger),
34
34
  PactPost.new(name, logger, session),
@@ -6,9 +6,10 @@ module Pact
6
6
  module RequestHandlers
7
7
  class InteractionPost < BaseAdministrationRequestHandler
8
8
 
9
- def initialize name, logger, session
9
+ def initialize name, logger, session, pact_specification_version
10
10
  super name, logger
11
11
  @session = session
12
+ @pact_specification_version = pact_specification_version
12
13
  end
13
14
 
14
15
  def request_path
@@ -21,7 +22,8 @@ module Pact
21
22
 
22
23
  def respond env
23
24
  request_body = env['rack.input'].string
24
- interaction = Interaction.from_hash(JSON.load(request_body)) # Load creates the Pact::XXX classes
25
+ parsing_options = { pact_specification_version: pact_specification_version }
26
+ interaction = Interaction.from_hash(JSON.load(request_body), parsing_options) # Load creates the Pact::XXX classes
25
27
 
26
28
  begin
27
29
  session.add_expected_interaction interaction
@@ -34,7 +36,7 @@ module Pact
34
36
 
35
37
  private
36
38
 
37
- attr_accessor :session
39
+ attr_accessor :session, :pact_specification_version
38
40
  end
39
41
  end
40
42
  end
@@ -8,9 +8,10 @@ module Pact
8
8
  module RequestHandlers
9
9
  class InteractionsPut < BaseAdministrationRequestHandler
10
10
 
11
- def initialize name, logger, session
11
+ def initialize name, logger, session, pact_specification_version
12
12
  super name, logger
13
13
  @session = session
14
+ @pact_specification_version = pact_specification_version
14
15
  end
15
16
 
16
17
  def request_path
@@ -23,7 +24,8 @@ module Pact
23
24
 
24
25
  def respond env
25
26
  request_body = JSON.load(env['rack.input'].string)
26
- interactions = request_body['interactions'].collect { | hash | Interaction.from_hash(hash) }
27
+ parsing_options = { pact_specification_version: pact_specification_version }
28
+ interactions = request_body['interactions'].collect { | hash | Interaction.from_hash(hash, parsing_options) }
27
29
  begin
28
30
  session.set_expected_interactions interactions
29
31
  text_response('Registered interactions')
@@ -34,7 +36,7 @@ module Pact
34
36
 
35
37
  private
36
38
 
37
- attr_accessor :session
39
+ attr_accessor :session, :pact_specification_version
38
40
 
39
41
  end
40
42
  end
@@ -3,6 +3,7 @@ require 'pact/mock_service/app'
3
3
  require 'pact/consumer/mock_service/set_location'
4
4
  require 'pact/mock_service/run'
5
5
  require 'pact/mock_service/server/webrick_request_monkeypatch'
6
+ require 'pact/specification_version'
6
7
 
7
8
  module Pact
8
9
  module MockService
@@ -50,6 +51,7 @@ module Pact
50
51
  end
51
52
 
52
53
  def service_options
54
+ # dummy pact_specification_version is needed to stop RequestHandlers blowing up
53
55
  service_options = {
54
56
  pact_dir: options[:pact_dir],
55
57
  log_level: options[:log_level],
@@ -57,7 +59,7 @@ module Pact
57
59
  consumer: options[:consumer],
58
60
  provider: options[:provider],
59
61
  cors_enabled: options[:cors],
60
- pact_specification_version: options[:pact_specification_version],
62
+ pact_specification_version: Pact::SpecificationVersion::NIL_VERSION.to_s,
61
63
  pactfile_write_mode: options[:pact_file_write_mode],
62
64
  stub_pactfile_paths: options[:stub_pactfile_paths]
63
65
  }
@@ -1,5 +1,5 @@
1
1
  module Pact
2
2
  module MockService
3
- VERSION = "2.9.3"
3
+ VERSION = "2.9.8"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pact-mock_service
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.9.3
4
+ version: 2.9.8
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: 2018-07-13 00:00:00.000000000 Z
15
+ date: 2018-07-23 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: rack