pact 1.9.1 → 1.9.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/pact/cli.rb +4 -0
- data/lib/pact/consumer/configuration/configuration_extensions.rb +8 -0
- data/lib/pact/provider/configuration/configuration_extension.rb +9 -1
- data/lib/pact/provider/pact_spec_runner.rb +9 -1
- data/lib/pact/version.rb +1 -1
- data/pact.gemspec +2 -2
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5fc5fdf84a97a69644fcff28cf7d4527e80149bd
|
4
|
+
data.tar.gz: f9b9c762622f188013b9f095b508389519aa39b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: de50e3af9ed13ac6c969e97ff407584de150b174a19bbbfa525bde9a69b7d3239d59a0204c2a51f27cbbbf4f1415705fbd14c8b1eb4f9875e5ae89d62bf5eaa1
|
7
|
+
data.tar.gz: b19f75f67613fbc1ec834f8487fb5eaa0373bcdb23baa13636f2212c7da6ea2bab16cfda9a8568fcfd804c6e8c94ee1c13e99f1848c6fca605f4a904e9d134fb
|
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.9.2 (26 May 2016)
|
6
|
+
* 88741ac - Merge pull request #104 from reevoo/randomise_contract_interactions (Sergei Matheson, Thu May 26 15:09:31 2016 +1000)
|
7
|
+
* 67c2b30 - Add interactions_replay_order and pactfile_write_order into Pact.configuration (Alex Malkov, Tue May 10 01:44:04 2016 +0100)
|
8
|
+
* 983a505 - Merge pull request #105 from elgalu/patch-2 (Beth Skurrie, Thu May 12 07:52:21 2016 +1000)
|
9
|
+
* 60d8b5c - "to need to need" README.md typo (Leo Gallucci, Wed May 11 17:39:49 2016 +0200)
|
10
|
+
* 2cb57f7 - Test on ruby 2.3.1 (Sergei Matheson, Tue May 3 16:37:40 2016 +1000)
|
11
|
+
* 4594a97 - Use at least v0.5.7 of pact-support (Sergei Matheson, Tue May 3 16:36:39 2016 +1000)
|
12
|
+
|
5
13
|
### 1.9.1 (3 May 2016)
|
6
14
|
* b3409a7 - Accept nil port as find and use available port (Taiki Ono, Wed Mar 16 19:34:46 2016 +0900)
|
7
15
|
* a7f644f - Update README URLs based on HTTP redirects (ReadmeCritic, Mon Mar 14 07:03:52 2016 -0700)
|
data/lib/pact/cli.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'thor'
|
2
2
|
require 'pact/consumer/configuration'
|
3
|
+
require 'pact/provider/configuration'
|
3
4
|
|
4
5
|
module Pact
|
5
6
|
class CLI < Thor
|
@@ -10,6 +11,9 @@ module Pact
|
|
10
11
|
method_option :pact_broker_username, aliases: "-u", desc: "Pact broker user name"
|
11
12
|
method_option :pact_broker_password, aliases: "-w", desc: "Pact broker password"
|
12
13
|
method_option :backtrace, aliases: "-b", desc: "Show full backtrace", :default => false, :type => :boolean
|
14
|
+
method_option :interactions_replay_order, aliases: "-o",
|
15
|
+
desc: "Interactions replay order: randomised or recorded (default)",
|
16
|
+
default: Pact.configuration.interactions_replay_order
|
13
17
|
method_option :description, aliases: "-d", desc: "Interaction description filter"
|
14
18
|
method_option :provider_state, aliases: "-s", desc: "Provider state filter"
|
15
19
|
|
@@ -70,6 +70,14 @@ module Pact
|
|
70
70
|
@pactfile_write_mode = pactfile_write_mode
|
71
71
|
end
|
72
72
|
|
73
|
+
def pactfile_write_order
|
74
|
+
@pactfile_write_order ||= :chronological #or :alphabetical
|
75
|
+
end
|
76
|
+
|
77
|
+
def pactfile_write_order= pactfile_write_order
|
78
|
+
@pactfile_write_order = pactfile_write_order.to_sym
|
79
|
+
end
|
80
|
+
|
73
81
|
private
|
74
82
|
|
75
83
|
#Would love a better way of determining this! It sure won't work on windows.
|
@@ -29,6 +29,14 @@ module Pact
|
|
29
29
|
@config_ru_path = config_ru_path
|
30
30
|
end
|
31
31
|
|
32
|
+
def interactions_replay_order
|
33
|
+
@interactions_replay_order ||= :recorder #or :randomised
|
34
|
+
end
|
35
|
+
|
36
|
+
def interactions_replay_order= interactions_replay_order
|
37
|
+
@interactions_replay_order = interactions_replay_order.to_sym
|
38
|
+
end
|
39
|
+
|
32
40
|
def include mod
|
33
41
|
Pact::Provider::State::ProviderStateConfiguredModules.instance_eval do
|
34
42
|
include mod
|
@@ -38,4 +46,4 @@ module Pact
|
|
38
46
|
end
|
39
47
|
end
|
40
48
|
end
|
41
|
-
end
|
49
|
+
end
|
@@ -121,10 +121,18 @@ module Pact
|
|
121
121
|
options = {
|
122
122
|
criteria: @options[:criteria]
|
123
123
|
}
|
124
|
-
honour_pactfile pact_source.uri, pact_source.pact_json, options
|
124
|
+
honour_pactfile pact_source.uri, ordered_pact_json(pact_source.pact_json), options
|
125
125
|
end
|
126
126
|
end
|
127
127
|
|
128
|
+
def ordered_pact_json(pact_json)
|
129
|
+
return pact_json if Pact.configuration.interactions_replay_order == :recorded
|
130
|
+
|
131
|
+
consumer_contract = JSON.parse(pact_json)
|
132
|
+
consumer_contract["interactions"] = consumer_contract["interactions"].shuffle
|
133
|
+
consumer_contract.to_json
|
134
|
+
end
|
135
|
+
|
128
136
|
def class_exists? name
|
129
137
|
Kernel.const_get name
|
130
138
|
rescue NameError
|
data/lib/pact/version.rb
CHANGED
data/pact.gemspec
CHANGED
@@ -27,8 +27,8 @@ Gem::Specification.new do |gem|
|
|
27
27
|
gem.add_runtime_dependency 'webrick'
|
28
28
|
gem.add_runtime_dependency 'term-ansicolor', '~> 1.0'
|
29
29
|
|
30
|
-
gem.add_runtime_dependency 'pact-support', '~> 0.5'
|
31
|
-
gem.add_runtime_dependency 'pact-mock_service', '~> 0.
|
30
|
+
gem.add_runtime_dependency 'pact-support', '~> 0.5.7'
|
31
|
+
gem.add_runtime_dependency 'pact-mock_service', '~> 0.8'
|
32
32
|
|
33
33
|
gem.add_development_dependency 'rake', '~> 10.0.3'
|
34
34
|
gem.add_development_dependency 'webmock', '~> 1.18.0'
|
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.9.
|
4
|
+
version: 1.9.2
|
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: 2016-05-
|
15
|
+
date: 2016-05-26 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: randexp
|
@@ -132,28 +132,28 @@ dependencies:
|
|
132
132
|
requirements:
|
133
133
|
- - "~>"
|
134
134
|
- !ruby/object:Gem::Version
|
135
|
-
version:
|
135
|
+
version: 0.5.7
|
136
136
|
type: :runtime
|
137
137
|
prerelease: false
|
138
138
|
version_requirements: !ruby/object:Gem::Requirement
|
139
139
|
requirements:
|
140
140
|
- - "~>"
|
141
141
|
- !ruby/object:Gem::Version
|
142
|
-
version:
|
142
|
+
version: 0.5.7
|
143
143
|
- !ruby/object:Gem::Dependency
|
144
144
|
name: pact-mock_service
|
145
145
|
requirement: !ruby/object:Gem::Requirement
|
146
146
|
requirements:
|
147
147
|
- - "~>"
|
148
148
|
- !ruby/object:Gem::Version
|
149
|
-
version: '0.
|
149
|
+
version: '0.8'
|
150
150
|
type: :runtime
|
151
151
|
prerelease: false
|
152
152
|
version_requirements: !ruby/object:Gem::Requirement
|
153
153
|
requirements:
|
154
154
|
- - "~>"
|
155
155
|
- !ruby/object:Gem::Version
|
156
|
-
version: '0.
|
156
|
+
version: '0.8'
|
157
157
|
- !ruby/object:Gem::Dependency
|
158
158
|
name: rake
|
159
159
|
requirement: !ruby/object:Gem::Requirement
|