pact-provider-verifier 1.14.7 → 1.15.0

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: 060abf0b3beb5fe80c835e552219cbba50bdae8274bae302b493e8e5d656108b
4
- data.tar.gz: 97123830702508c8e723a10a5875fb38cd2df1ee2b2585ae40edba48028e71ea
3
+ metadata.gz: 68a5df8078a6d2408f6afadb8f956365f673ceed3736cdfbceb33bbebf1e89e9
4
+ data.tar.gz: e992a96f7b210b0b7cef7020e2c6fa5b31d7247f4ad45e932cd4489f2b7537fe
5
5
  SHA512:
6
- metadata.gz: 472bbddeb5fad5ea02975716203a4acfbf1fb3d94031ff8335768b86368e939a003d18abccd0001be59edcbaa3c402a79b8344dfca7b32620a524af85bf47988
7
- data.tar.gz: c127e80ff166db069d9ee94a3c497b8afe0db2c99b8a266fb5ff48d98d75f05c5ae5bf0db89d1607980df1542e538b278a0254c840276c4b3a9fad22519c5779
6
+ metadata.gz: f6526309c0ad113f6c5c6c80d086143387a45b36e3fe77a96bf2da0b2494120b3c7cae13a7fdbf07a70a0794d62b7eceee506932333f9fb248f38697fee923de
7
+ data.tar.gz: 5d6ec539e538572eebd3648a64f83beed3325d823214ac4d26b69ce0b879030119198a2b2a91fd43e7fa8e633b3200b9dff1d92be0b09ec5e23847795abe36a2
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ <a name="v1.15.0-1"></a>
2
+ ### v1.15.0-1 (2018-07-13)
3
+
4
+
5
+ #### Features
6
+
7
+ * print a new line between JSON documents when using --format json ([dc90d8e](/../../commit/dc90d8e))
8
+
9
+
1
10
  <a name="v1.14.4-1"></a>
2
11
  ### v1.14.4-1 (2018-07-10)
3
12
 
@@ -40,6 +40,7 @@ module Pact
40
40
  def setup
41
41
  print_deprecation_note
42
42
  set_environment_variables
43
+ require_rspec_monkeypatch_for_jsonl
43
44
  require_pact_project_pact_helper # Beth: not sure if this is needed, hangover from pact-provider-proxy?
44
45
  end
45
46
 
@@ -127,6 +128,12 @@ module Pact
127
128
  require ENV['PACT_PROJECT_PACT_HELPER'] if ENV.fetch('PACT_PROJECT_PACT_HELPER','') != ''
128
129
  end
129
130
 
131
+ def require_rspec_monkeypatch_for_jsonl
132
+ if options.format == 'json'
133
+ require 'pact/provider_verifier/rspec_json_formatter_monkeypatch'
134
+ end
135
+ end
136
+
130
137
  def custom_provider_headers_for_env_var
131
138
  if options.custom_provider_header && options.custom_provider_header.any?
132
139
  options.custom_provider_header.join("\n")
@@ -0,0 +1,34 @@
1
+ require 'rspec'
2
+
3
+ begin
4
+ require 'rspec/core/formatters/json_formatter'
5
+
6
+ RSpec::Core::Formatters::JsonFormatter
7
+
8
+ # This looks dodgy, but it's actually safer than inheriting from
9
+ # RSpec::Core::Formatters::JsonFormatter and using a custom class,
10
+ # because if the JsonFormatter class gets refactored,
11
+ # the --format json option will still work, but the inheritance will break.
12
+
13
+ module RSpec
14
+ module Core
15
+ module Formatters
16
+ class JsonFormatter
17
+ alias_method :old_close, :close
18
+
19
+ def close(*args)
20
+ # Append a new line so that the output stream can be split at
21
+ # the new lines, and each JSON document parsed separately
22
+ old_close(*args)
23
+ output.write("\n")
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
29
+
30
+ rescue NameError
31
+ Pact.configuration.error_stream.puts "WARN: Could not find RSpec::Core::Formatters::JsonFormatter to modify it to put a new line between JSON result documents."
32
+ rescue LoadError
33
+ Pact.configuration.error_stream.puts "WARN: Could not load rspec/core/formatters/json_formatter to modify it to put a new line between JSON result documents."
34
+ end
@@ -1,5 +1,5 @@
1
1
  module Pact
2
2
  module ProviderVerifier
3
- VERSION = "1.14.7"
3
+ VERSION = "1.15.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pact-provider-verifier
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.14.7
4
+ version: 1.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Fellows
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-07-11 00:00:00.000000000 Z
12
+ date: 2018-07-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
@@ -303,6 +303,7 @@ files:
303
303
  - lib/pact/provider_verifier/cli/custom_thor.rb
304
304
  - lib/pact/provider_verifier/cli/verify.rb
305
305
  - lib/pact/provider_verifier/pact_helper.rb
306
+ - lib/pact/provider_verifier/rspec_json_formatter_monkeypatch.rb
306
307
  - lib/pact/provider_verifier/set_up_provider_state.rb
307
308
  - lib/pact/provider_verifier/underscored_headers_monkeypatch.rb
308
309
  - lib/pact/provider_verifier/version.rb