pact 1.42.2 → 1.42.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 0474bd7952ce4b9a67c3a29050ea326e7e54b3e3
4
- data.tar.gz: 073ab40f512ec4e1e7eae901d2b909a71585cb31
2
+ SHA256:
3
+ metadata.gz: 5246cb251aaa720174fe319b2b7d0f0b9d73bedefb122549704f47db4340541c
4
+ data.tar.gz: e67c6ce61ec87143e7241bee0c1e5238d297dce10ad7b8659601c39d496014c1
5
5
  SHA512:
6
- metadata.gz: 0e7fb5c4c756c4121be44a68b2f087a4102abd358921860f6d0521c72b460f8c3cff6a5f8a917da04413fc9ab17c29d465087b39ee674a775b261253e5f59c70
7
- data.tar.gz: bf2a07fe45465e1600abcb7a6e807046e3aa7d013be5a746d1a4a5d005e5a711997d9d7c8cf7e985c7c7ca99d90bac64b05ca67724997785cb1e94416d90944c
6
+ metadata.gz: '082aafe21839f9a13a49ef86b2782582bdde8cca49ed6486125191950627c7d14e08c48c84e9e3e56ee499eb3535b9c9eab9fdb815a52256fa05aff3f2db7afa'
7
+ data.tar.gz: acacef55a6d67049dad4bcf3a8d30e200f4187ef08ff8cee0a52e74677fc603561a09afe6c4afbac7578cf223e3a4a81619df96b7e7062cec6b35e7554cc395b
data/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ <a name="v1.42.3"></a>
2
+ ### v1.42.3 (2019-11-15)
3
+
4
+
5
+ #### Bug Fixes
6
+
7
+ * **verify**
8
+ * exit with status 0 if all pacts are in pending state ([2f7110b](/../../commit/2f7110b))
9
+
10
+
1
11
  <a name="v1.42.2"></a>
2
12
  ### v1.42.2 (2019-11-09)
3
13
 
@@ -29,7 +29,7 @@ module Pact
29
29
 
30
30
  def after_suite
31
31
  if Pact.consumer_world.any_pact_examples_ran?
32
- Pact.consumer_world.consumer_contract_builders.each { | c | c.write_pact }
32
+ Pact.consumer_world.consumer_contract_builders.each(&:write_pact)
33
33
  Pact::Doc::Generate.call
34
34
  Pact::MockService::AppManager.instance.kill_all
35
35
  Pact::MockService::AppManager.instance.clear_all
@@ -37,4 +37,4 @@ module Pact
37
37
  end
38
38
  end
39
39
  end
40
- end
40
+ end
@@ -3,7 +3,7 @@ module Pact
3
3
  class SortInteractions
4
4
 
5
5
  def self.call interactions
6
- interactions.sort{|a, b| sortable_id(a) <=> sortable_id(b)}
6
+ interactions.sort_by { |interaction| sortable_id(interaction) }
7
7
  end
8
8
 
9
9
  private
@@ -11,7 +11,6 @@ module Pact
11
11
  def self.sortable_id interaction
12
12
  "#{interaction.description.downcase} #{interaction.response.status} #{(interaction.provider_state || '').downcase}"
13
13
  end
14
-
15
14
  end
16
15
  end
17
- end
16
+ end
@@ -22,4 +22,3 @@ module Pact
22
22
  end
23
23
  end
24
24
  end
25
-
@@ -91,7 +91,7 @@ module Pact
91
91
  ::RSpec::Core::CommandLine.new(NoConfigurationOptions.new)
92
92
  .run(::RSpec.configuration.output_stream, ::RSpec.configuration.error_stream)
93
93
  end
94
- options[:ignore_failures] ? 0 : exit_code
94
+ (all_pacts_pending? || options[:ignore_failures]) ? 0 : exit_code
95
95
  end
96
96
 
97
97
  def rspec_runner_options
@@ -159,6 +159,10 @@ module Pact
159
159
  consumer_contract.to_json
160
160
  end
161
161
 
162
+ def all_pacts_pending?
163
+ pact_urls.all?{ | pact_url| pact_url.metadata[:pending] }
164
+ end
165
+
162
166
  def class_exists? name
163
167
  Kernel.const_get name
164
168
  rescue NameError
@@ -54,7 +54,7 @@ module Pact
54
54
  end
55
55
 
56
56
  def rack_request_header_for header
57
- with_http_prefix(header.to_s.upcase).gsub('-', '_')
57
+ with_http_prefix(header.to_s.upcase).tr('-', '_')
58
58
  end
59
59
 
60
60
  def rack_request_value_for value
@@ -76,7 +76,7 @@ module Pact
76
76
  pact_interaction: interaction,
77
77
  pact_interaction_example_description: interaction_description_for_rerun_command(interaction),
78
78
  pact_uri: options[:pact_uri],
79
- pact_ignore_failures: options[:pact_uri].metadata[:pending]
79
+ pact_ignore_failures: options[:pact_uri].metadata[:pending] || options[:ignore_failures]
80
80
  }
81
81
 
82
82
  describe description_for(interaction), metadata do
@@ -46,7 +46,7 @@ module Pact
46
46
  def tear_down_provider_states provider_states, consumer, options = {}
47
47
  # If there are no provider state, execute with an nil state to ensure global and base states are executed
48
48
  Pact.configuration.provider_state_tear_down.call(nil, consumer, options) if provider_states.nil? || provider_states.empty?
49
- provider_states.reverse.each do | provider_state |
49
+ provider_states.reverse_each do | provider_state |
50
50
  Pact.configuration.provider_state_tear_down.call(provider_state.name, consumer, options.merge(params: provider_state.params))
51
51
  end
52
52
  end
@@ -43,7 +43,7 @@ module Pact
43
43
  end
44
44
 
45
45
  def pact_uris_from_pact_uri_sources
46
- pact_uri_sources.collect{| pact_uri_source| pact_uri_source.call }.flatten
46
+ pact_uri_sources.collect(&:call).flatten
47
47
  end
48
48
  end
49
49
  end
data/lib/pact/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # Remember to bump pact-provider-proxy when this changes major version
2
2
  module Pact
3
- VERSION = "1.42.2"
3
+ VERSION = "1.42.3"
4
4
  end
data/pact.gemspec CHANGED
@@ -26,7 +26,6 @@ Gem::Specification.new do |gem|
26
26
  'documentation_uri' => 'https://github.com/pact-foundation/pact-ruby/blob/master/README.md'
27
27
  }
28
28
 
29
- gem.add_runtime_dependency 'randexp', '~> 0.1.7'
30
29
  gem.add_runtime_dependency 'rspec', '>=2.14'
31
30
  gem.add_runtime_dependency 'rack-test', '>= 0.6.3', '< 2.0.0'
32
31
  gem.add_runtime_dependency 'thor'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pact
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.42.2
4
+ version: 1.42.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Fraser
@@ -12,22 +12,8 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2019-11-09 00:00:00.000000000 Z
15
+ date: 2019-11-15 00:00:00.000000000 Z
16
16
  dependencies:
17
- - !ruby/object:Gem::Dependency
18
- name: randexp
19
- requirement: !ruby/object:Gem::Requirement
20
- requirements:
21
- - - "~>"
22
- - !ruby/object:Gem::Version
23
- version: 0.1.7
24
- type: :runtime
25
- prerelease: false
26
- version_requirements: !ruby/object:Gem::Requirement
27
- requirements:
28
- - - "~>"
29
- - !ruby/object:Gem::Version
30
- version: 0.1.7
31
17
  - !ruby/object:Gem::Dependency
32
18
  name: rspec
33
19
  requirement: !ruby/object:Gem::Requirement
@@ -400,7 +386,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
400
386
  version: '0'
401
387
  requirements: []
402
388
  rubyforge_project:
403
- rubygems_version: 2.6.14.3
389
+ rubygems_version: 2.7.6
404
390
  signing_key:
405
391
  specification_version: 4
406
392
  summary: Enables consumer driven contract testing, providing a mock service and DSL