pact 1.12.0 → 1.13.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 +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/pact/provider/configuration/configuration_extension.rb +18 -0
- data/lib/pact/provider/pact_spec_runner.rb +1 -1
- data/lib/pact/provider/state/set_up.rb +13 -0
- data/lib/pact/provider/state/tear_down.rb +13 -0
- data/lib/pact/provider/test_methods.rb +4 -5
- data/lib/pact/provider/verification_results/create.rb +6 -6
- data/lib/pact/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6b7c1f10b20330a3cd61a9711a0006c1b68b405d
|
|
4
|
+
data.tar.gz: a5c26183ea7edfe7bbffa51d14b0cd6bdca99316
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dc23c2a873a0c773e40f884e1c2f7fb9404cdcf727fcd10adb825614f14e28ddc77d3debb129916f0965b6fd721f6003248bc45037d7086233b347bcee510dfa
|
|
7
|
+
data.tar.gz: 4630267e5c71b46d053a1a2a6ce6131655fc7908b381e497a548474029c5481de635a7fd2ed2d1d01897b5ff2fa0c091786064535d55320b9b6e2b0f2faf579f
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@ Do this to generate your change history
|
|
|
2
2
|
|
|
3
3
|
git log --pretty=format:' * %h - %s (%an, %ad)' vX.Y.Z..HEAD
|
|
4
4
|
|
|
5
|
+
## 1.13.0 (26 May 2017)
|
|
6
|
+
* c9800b0 - Make the code to call for provider state set up and tear down configurable. (Beth Skurrie, Fri May 26 14:32:34 2017 +1000)
|
|
7
|
+
|
|
8
|
+
## 1.12.1 (23 May 2017)
|
|
9
|
+
* 47140b7 - Update .travis.yml to publish to rubygems (Beth Skurrie, Tue May 23 16:23:21 2017 +1000)
|
|
10
|
+
* 16c40bd - Use RSpec.configuration.reporter.failed_examples to get failed examples instead of the suite, as it is backwards compatible with rspec 3.0.0 (Beth Skurrie, Tue May 23 15:59:36 2017 +1000)
|
|
11
|
+
* c54a3a9 - Add specs and tasks for doing manual end to end testing (create, publish, verify, publish verification) (Beth Skurrie, Tue May 23 15:45:41 2017 +1000)
|
|
12
|
+
|
|
5
13
|
## 1.12.0 (12 May 2017)
|
|
6
14
|
* e12ce11 - Updated pact-mock_service and pact-support gems. Major change: provider_state is now providerState in pact files. (Beth Skurrie, Fri May 12 08:43:04 2017 +1000)
|
|
7
15
|
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
require 'pact/provider/state/provider_state'
|
|
2
2
|
require 'pact/provider/state/provider_state_configured_modules'
|
|
3
|
+
require 'pact/provider/state/set_up'
|
|
4
|
+
require 'pact/provider/state/tear_down'
|
|
3
5
|
|
|
4
6
|
module Pact
|
|
5
7
|
|
|
@@ -39,6 +41,22 @@ module Pact
|
|
|
39
41
|
@interactions_replay_order = interactions_replay_order.to_sym
|
|
40
42
|
end
|
|
41
43
|
|
|
44
|
+
def provider_state_set_up
|
|
45
|
+
@provider_state_set_up ||= Pact::Provider::State::SetUp
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def provider_state_set_up= provider_state_set_up
|
|
49
|
+
@provider_state_set_up = provider_state_set_up
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def provider_state_tear_down
|
|
53
|
+
@provider_state_tear_down ||= Pact::Provider::State::TearDown
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
def provider_state_tear_down= provider_state_tear_down
|
|
57
|
+
@provider_state_tear_down = provider_state_tear_down
|
|
58
|
+
end
|
|
59
|
+
|
|
42
60
|
def include mod
|
|
43
61
|
Pact::Provider::State::ProviderStateConfiguredModules.instance_eval do
|
|
44
62
|
include mod
|
|
@@ -83,7 +83,7 @@ module Pact
|
|
|
83
83
|
config.after(:suite) do | suite |
|
|
84
84
|
Pact::Provider::Help::Write.call(jsons)
|
|
85
85
|
Pact::RSpec.with_rspec_3 do
|
|
86
|
-
Pact::Provider::VerificationResults::PublishAll.call(sources,
|
|
86
|
+
Pact::Provider::VerificationResults::PublishAll.call(sources, ::RSpec.configuration.reporter.failed_examples)
|
|
87
87
|
end
|
|
88
88
|
end
|
|
89
89
|
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
require 'pact/provider/state/provider_state_manager'
|
|
2
|
+
|
|
3
|
+
module Pact
|
|
4
|
+
module Provider
|
|
5
|
+
module State
|
|
6
|
+
class SetUp
|
|
7
|
+
def self.call provider_state_name, consumer, options = {}
|
|
8
|
+
State::ProviderStateManager.new(provider_state_name, consumer).set_up_provider_state
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
require 'pact/provider/state/provider_state_manager'
|
|
2
|
+
|
|
3
|
+
module Pact
|
|
4
|
+
module Provider
|
|
5
|
+
module State
|
|
6
|
+
class TearDown
|
|
7
|
+
def self.call provider_state_name, consumer, options = {}
|
|
8
|
+
State::ProviderStateManager.new(provider_state_name, consumer).tear_down_provider_state
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -34,14 +34,13 @@ module Pact
|
|
|
34
34
|
end
|
|
35
35
|
end
|
|
36
36
|
|
|
37
|
-
def set_up_provider_state provider_state_name, consumer
|
|
38
|
-
|
|
37
|
+
def set_up_provider_state provider_state_name, consumer, options = {}
|
|
38
|
+
Pact.configuration.provider_state_set_up.call(provider_state_name, consumer, options)
|
|
39
39
|
end
|
|
40
40
|
|
|
41
|
-
def tear_down_provider_state provider_state_name, consumer
|
|
42
|
-
|
|
41
|
+
def tear_down_provider_state provider_state_name, consumer, options = {}
|
|
42
|
+
Pact.configuration.provider_state_tear_down.call(provider_state_name, consumer, options)
|
|
43
43
|
end
|
|
44
|
-
|
|
45
44
|
end
|
|
46
45
|
end
|
|
47
46
|
end
|
|
@@ -4,13 +4,13 @@ module Pact
|
|
|
4
4
|
module VerificationResults
|
|
5
5
|
class Create
|
|
6
6
|
|
|
7
|
-
def self.call pact_json,
|
|
8
|
-
new(pact_json,
|
|
7
|
+
def self.call pact_json, failed_examples
|
|
8
|
+
new(pact_json, failed_examples).call
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
-
def initialize pact_json,
|
|
11
|
+
def initialize pact_json, failed_examples
|
|
12
12
|
@pact_json = pact_json
|
|
13
|
-
@
|
|
13
|
+
@failed_examples = failed_examples
|
|
14
14
|
end
|
|
15
15
|
|
|
16
16
|
def call
|
|
@@ -28,14 +28,14 @@ module Pact
|
|
|
28
28
|
end
|
|
29
29
|
|
|
30
30
|
def count_failures_for_pact_json
|
|
31
|
-
|
|
31
|
+
failed_examples.collect{ |e| e.metadata[:pact_json] == pact_json }.uniq.size
|
|
32
32
|
end
|
|
33
33
|
|
|
34
34
|
def any_failures?
|
|
35
35
|
count_failures_for_pact_json > 0
|
|
36
36
|
end
|
|
37
37
|
|
|
38
|
-
attr_reader :pact_json, :
|
|
38
|
+
attr_reader :pact_json, :failed_examples
|
|
39
39
|
end
|
|
40
40
|
end
|
|
41
41
|
end
|
data/lib/pact/version.rb
CHANGED
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.
|
|
4
|
+
version: 1.13.0
|
|
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: 2017-05-
|
|
15
|
+
date: 2017-05-26 00:00:00.000000000 Z
|
|
16
16
|
dependencies:
|
|
17
17
|
- !ruby/object:Gem::Dependency
|
|
18
18
|
name: randexp
|
|
@@ -330,6 +330,8 @@ files:
|
|
|
330
330
|
- lib/pact/provider/state/provider_state_configured_modules.rb
|
|
331
331
|
- lib/pact/provider/state/provider_state_manager.rb
|
|
332
332
|
- lib/pact/provider/state/provider_state_proxy.rb
|
|
333
|
+
- lib/pact/provider/state/set_up.rb
|
|
334
|
+
- lib/pact/provider/state/tear_down.rb
|
|
333
335
|
- lib/pact/provider/test_methods.rb
|
|
334
336
|
- lib/pact/provider/verification_report.rb
|
|
335
337
|
- lib/pact/provider/verification_results/create.rb
|