pact 0.1.37 → 1.0.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.
Files changed (65) hide show
  1. data/Gemfile.lock +6 -19
  2. data/example/zoo-app/Gemfile +1 -2
  3. data/example/zoo-app/Gemfile.lock +16 -13
  4. data/example/zoo-app/spec/pacts/zoo_app-animal_service.json +6 -6
  5. data/lib/pact/consumer/app_manager.rb +8 -28
  6. data/lib/pact/consumer/consumer_contract_builder.rb +65 -36
  7. data/lib/pact/consumer/dsl.rb +20 -10
  8. data/lib/pact/consumer/interaction_builder.rb +42 -0
  9. data/lib/pact/consumer/interactions_filter.rb +41 -0
  10. data/lib/pact/consumer/mock_service.rb +26 -19
  11. data/lib/pact/consumer/rspec.rb +2 -3
  12. data/lib/pact/consumer/server.rb +90 -0
  13. data/lib/pact/consumer.rb +6 -3
  14. data/lib/pact/consumer_contract/consumer_contract.rb +103 -0
  15. data/lib/pact/consumer_contract/interaction.rb +70 -0
  16. data/lib/pact/consumer_contract/service_consumer.rb +20 -0
  17. data/lib/pact/consumer_contract/service_provider.rb +20 -0
  18. data/lib/pact/consumer_contract.rb +1 -112
  19. data/lib/pact/{producer → provider}/dsl.rb +15 -4
  20. data/lib/pact/{producer → provider}/matchers.rb +0 -0
  21. data/lib/pact/{producer → provider}/pact_spec_runner.rb +2 -2
  22. data/lib/pact/{producer/producer_state.rb → provider/provider_state.rb} +13 -22
  23. data/lib/pact/provider/rspec.rb +128 -1
  24. data/lib/pact/{producer → provider}/test_methods.rb +12 -12
  25. data/lib/pact/{producer.rb → provider.rb} +0 -0
  26. data/lib/pact/verification_task.rb +4 -4
  27. data/lib/pact/version.rb +1 -1
  28. data/lib/pact.rb +1 -1
  29. data/pact.gemspec +1 -2
  30. data/scratchpad.txt +1 -1
  31. data/spec/features/consumption_spec.rb +15 -23
  32. data/spec/features/production_spec.rb +5 -5
  33. data/spec/features/{producer_states → provider_states}/zebras.rb +3 -3
  34. data/spec/integration/pact/consumer_configuration_spec.rb +3 -66
  35. data/spec/integration/pact/provider_configuration_spec.rb +1 -1
  36. data/spec/lib/pact/consumer/consumer_contract_builder_spec.rb +59 -15
  37. data/spec/lib/pact/consumer/dsl_spec.rb +4 -5
  38. data/spec/lib/pact/consumer/interaction_builder_spec.rb +91 -0
  39. data/spec/lib/pact/consumer/interactions_spec.rb +64 -0
  40. data/spec/lib/pact/consumer/mock_service_spec.rb +2 -6
  41. data/spec/lib/pact/consumer/service_consumer_spec.rb +1 -1
  42. data/spec/lib/pact/{consumer_contract_spec.rb → consumer_contract/consumer_contract_spec.rb} +72 -28
  43. data/spec/lib/pact/{consumer → consumer_contract}/interaction_spec.rb +49 -64
  44. data/spec/lib/pact/{producer/configuration_dsl_spec.rb → provider/dsl_spec.rb} +29 -28
  45. data/spec/lib/pact/{producer/producer_state_spec.rb → provider/provider_state_spec.rb} +17 -17
  46. data/spec/lib/pact/{producer → provider}/rspec_spec.rb +1 -1
  47. data/spec/lib/pact/verification_task_spec.rb +3 -3
  48. data/spec/spec_helper.rb +1 -0
  49. data/spec/support/a_consumer-a_producer.json +1 -1
  50. data/spec/support/a_consumer-a_provider.json +34 -0
  51. data/spec/support/consumer_contract_template.json +26 -0
  52. data/spec/support/factories.rb +78 -0
  53. data/spec/support/pact_rake_support.rb +1 -1
  54. data/spec/support/test_app_fail.json +1 -1
  55. data/spec/support/test_app_pass.json +1 -1
  56. data/tasks/pact-test.rake +3 -3
  57. metadata +38 -45
  58. data/lib/pact/consumer/configuration_dsl.rb +0 -73
  59. data/lib/pact/consumer/interaction.rb +0 -74
  60. data/lib/pact/consumer/run_condor.rb +0 -4
  61. data/lib/pact/consumer/run_mock_contract_service.rb +0 -13
  62. data/lib/pact/consumer/service_consumer.rb +0 -22
  63. data/lib/pact/consumer/service_producer.rb +0 -23
  64. data/lib/pact/producer/configuration_dsl.rb +0 -62
  65. data/lib/pact/producer/rspec.rb +0 -129
@@ -1,95 +1,96 @@
1
1
  require 'spec_helper'
2
- require 'pact/producer/configuration_dsl'
2
+ require 'pact/provider/dsl'
3
3
 
4
- module Pact::Producer
5
- describe ConfigurationDSL do
4
+ module Pact::Provider
5
+ describe DSL do
6
6
 
7
7
  class MockConfig
8
- include ConfigurationDSL
8
+ include Pact::Provider::DSL
9
9
  end
10
10
 
11
- describe "producer" do
11
+ describe "service_provider" do
12
+
13
+ before do
14
+ Pact.clear_configuration
15
+ end
16
+
12
17
  let(:mock_config) { MockConfig.new }
13
- context "when a producer is configured" do
18
+ context "when a provider is configured" do
14
19
  before do
15
- mock_config.producer do
16
- name "Fred"
20
+ mock_config.service_provider "Fred" do
17
21
  app { "An app" }
18
22
  end
19
23
  end
20
24
  it "should allow configuration of the name" do
21
- expect(mock_config.producer.name).to eql "Fred"
25
+ expect(Pact.configuration.provider.name).to eql "Fred"
22
26
  end
23
27
  it "should allow configuration of the test app" do
24
- expect(mock_config.producer.app).to eql "An app"
28
+ expect(Pact.configuration.provider.app).to eql "An app"
25
29
  end
26
30
  end
27
- context "when a producer is not configured" do
31
+ #Move this test to configuration
32
+ context "when a provider is not configured" do
28
33
  it "raises an error" do
29
- expect{ mock_config.producer }.to raise_error(/Please configure your producer/)
34
+ expect{ Pact.configuration.provider }.to raise_error(/Please configure your provider/)
30
35
  end
31
36
  end
32
37
  end
33
38
 
34
39
 
35
- module ConfigurationDSL
40
+ module DSL
36
41
 
37
- describe ProducerDSL do
42
+ describe ServiceProviderDSL do
38
43
 
39
44
  describe "initialize" do
40
45
 
41
46
  context "with an object instead of a block" do
42
47
  subject do
43
- ProducerDSL.new do
44
- name nil
48
+ ServiceProviderDSL.new 'name' do
45
49
  app 'blah'
46
50
  end
47
51
  end
48
52
  it "raises an error" do
49
- expect{ subject }.to raise_error
53
+ expect{ subject }.to raise_error /wrong number of arguments/
50
54
  end
51
55
  end
52
56
 
53
-
54
57
  end
55
58
  describe "validate" do
56
59
  context "when no name is provided" do
57
60
  subject do
58
- ProducerDSL.new do
61
+ ServiceProviderDSL.new ' ' do
59
62
  app { Object.new }
60
63
  end
61
64
  end
62
65
  it "raises an error" do
63
- expect{ subject.validate}.to raise_error("Please provide a name for the Producer")
66
+ expect{ subject.validate}.to raise_error("Please provide a name for the Provider")
64
67
  end
65
68
  end
66
69
  context "when nil name is provided" do
67
70
  subject do
68
- ProducerDSL.new do
69
- name nil
71
+ ServiceProviderDSL.new nil do
70
72
  app { Object.new }
71
73
  end
72
74
  end
73
75
  it "raises an error" do
74
- expect{ subject.validate}.to raise_error("Please provide a name for the Producer")
76
+ expect{ subject.validate}.to raise_error("Please provide a name for the Provider")
75
77
  end
76
78
  end
77
79
  context "when no app is provided" do
78
80
  subject do
79
- ProducerDSL.new do
80
- name 'Blah'
81
+ ServiceProviderDSL.new 'Blah' do
81
82
  end
82
83
  end
83
84
  it "raises an error" do
84
- expect{ subject.validate }.to raise_error("Please configure an app for the Producer")
85
+ expect{ subject.validate }.to raise_error("Please configure an app for the Provider")
85
86
  end
86
87
  end
87
88
  end
88
89
  end
89
90
 
90
- describe ProducerConfig do
91
+ describe ServiceProviderConfig do
91
92
  describe "app" do
92
- subject { ProducerConfig.new("blah") { Object.new } }
93
+ subject { ServiceProviderConfig.new("blah") { Object.new } }
93
94
  it "should execute the app_block each time" do
94
95
  expect(subject.app.object_id).to_not equal(subject.app.object_id)
95
96
  end
@@ -1,14 +1,14 @@
1
1
  require 'spec_helper'
2
- require 'pact/producer/producer_state'
2
+ require 'pact/provider/provider_state'
3
3
 
4
4
  module Pact
5
- module Producer
5
+ module Provider
6
6
 
7
- describe 'global ProducerState' do
7
+ describe 'global ProviderState' do
8
8
 
9
9
  MESSAGES = []
10
10
 
11
- Pact.producer_state :no_alligators do
11
+ Pact.provider_state :no_alligators do
12
12
  set_up do
13
13
  MESSAGES << 'set_up'
14
14
  end
@@ -17,14 +17,14 @@ module Pact
17
17
  end
18
18
  end
19
19
 
20
- Pact.producer_state 'some alligators' do
20
+ Pact.provider_state 'some alligators' do
21
21
  end
22
22
 
23
23
  before do
24
24
  MESSAGES.clear
25
25
  end
26
26
 
27
- subject { ProducerState.get('no_alligators') }
27
+ subject { ProviderState.get('no_alligators') }
28
28
 
29
29
  describe 'set_up' do
30
30
  it 'should call the block passed to set_up' do
@@ -42,32 +42,32 @@ module Pact
42
42
 
43
43
  describe '.get' do
44
44
  context 'when the name is a matching symbol' do
45
- it 'will return the ProducerState' do
46
- ProducerState.get('no_alligators').should_not be_nil
45
+ it 'will return the ProviderState' do
46
+ ProviderState.get('no_alligators').should_not be_nil
47
47
  end
48
48
  end
49
49
  context 'when the name is a matching string' do
50
- it 'will return the ProducerState' do
51
- ProducerState.get('some alligators').should_not be_nil
50
+ it 'will return the ProviderState' do
51
+ ProviderState.get('some alligators').should_not be_nil
52
52
  end
53
53
  end
54
54
  end
55
55
  end
56
56
 
57
57
 
58
- describe 'namespaced ProducerStates' do
58
+ describe 'namespaced ProviderStates' do
59
59
 
60
60
  NAMESPACED_MESSAGES = []
61
61
 
62
- Pact.with_consumer 'a consumer' do
63
- producer_state 'the weather is sunny' do
62
+ Pact.provider_states_for 'a consumer' do
63
+ provider_state 'the weather is sunny' do
64
64
  set_up do
65
65
  NAMESPACED_MESSAGES << 'sunny!'
66
66
  end
67
67
  end
68
68
  end
69
69
 
70
- Pact.producer_state 'the weather is cloudy' do
70
+ Pact.provider_state 'the weather is cloudy' do
71
71
  set_up do
72
72
  NAMESPACED_MESSAGES << 'cloudy :('
73
73
  end
@@ -80,11 +80,11 @@ module Pact
80
80
  describe '.get' do
81
81
  context 'for a consumer' do
82
82
  it 'has a namespaced name' do
83
- ProducerState.get('the weather is sunny', :for => 'a consumer').should_not be_nil
83
+ ProviderState.get('the weather is sunny', :for => 'a consumer').should_not be_nil
84
84
  end
85
85
 
86
86
  it 'falls back to a global state of the same name if one is not found for the specified consumer' do
87
- ProducerState.get('the weather is cloudy', :for => 'a consumer').should_not be_nil
87
+ ProviderState.get('the weather is cloudy', :for => 'a consumer').should_not be_nil
88
88
  end
89
89
  end
90
90
 
@@ -93,7 +93,7 @@ module Pact
93
93
  describe 'set_up' do
94
94
  context 'for a consumer' do
95
95
  it 'runs its own setup' do
96
- ProducerState.get('the weather is sunny', :for => 'a consumer').set_up
96
+ ProviderState.get('the weather is sunny', :for => 'a consumer').set_up
97
97
  NAMESPACED_MESSAGES.should eq ['sunny!']
98
98
  end
99
99
  end
@@ -31,7 +31,7 @@ describe "the match_term matcher" do
31
31
  end
32
32
 
33
33
  # Note: because a consumer specifies only the keys it cares about, the pact ignores keys that are returned
34
- # by the producer, but not are not specified in the pact. This means that any hash will match an
34
+ # by the provider, but not are not specified in the pact. This means that any hash will match an
35
35
  # expected empty hash, because there is currently no way for a consumer to expect an absence of keys.
36
36
  it 'is confused by an empty hash' do
37
37
  expect({:hello => 'everyone'}).to match_term({})
@@ -27,14 +27,14 @@ module Pact
27
27
  let(:consumer_contract) { [ uri: @pact_uri, support_file: @support_file, consumer: @consumer] }
28
28
 
29
29
  it 'verifies the pacts using PactSpecRunner' do
30
- Producer::PactSpecRunner.should_receive(:run).with(consumer_contract).and_return(0)
30
+ Provider::PactSpecRunner.should_receive(:run).with(consumer_contract).and_return(0)
31
31
  Rake::Task[@task_name].execute
32
32
  end
33
33
 
34
34
  context 'when all specs pass' do
35
35
 
36
36
  before do
37
- Producer::PactSpecRunner.stub(:run).and_return(0)
37
+ Provider::PactSpecRunner.stub(:run).and_return(0)
38
38
  end
39
39
 
40
40
  it 'does not raise an exception' do
@@ -45,7 +45,7 @@ module Pact
45
45
  context 'when one or more specs fail' do
46
46
 
47
47
  before do
48
- Producer::PactSpecRunner.stub(:run).and_return(1)
48
+ Provider::PactSpecRunner.stub(:run).and_return(1)
49
49
  end
50
50
 
51
51
  it 'raises an exception' do
data/spec/spec_helper.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require 'rspec'
2
2
  require 'pact'
3
3
  require 'webmock/rspec'
4
+ require_relative 'support/factories'
4
5
 
5
6
  WebMock.disable_net_connect!(allow_localhost: true)
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "producer": {
3
- "name": "a producer"
3
+ "name": "an old producer"
4
4
  },
5
5
  "consumer": {
6
6
  "name": "a consumer"
@@ -0,0 +1,34 @@
1
+ {
2
+ "provider": {
3
+ "name": "a provider"
4
+ },
5
+ "consumer": {
6
+ "name": "a consumer"
7
+ },
8
+ "interactions": [
9
+ {
10
+ "description": "request one",
11
+ "request": {
12
+ "method": "get",
13
+ "path": "/path_one"
14
+ },
15
+ "response": {
16
+ },
17
+ "provider_state": "state one"
18
+ },
19
+ {
20
+ "description": "request two",
21
+ "request": {
22
+ "method": "get",
23
+ "path": "/path_two"
24
+ },
25
+ "response": {
26
+ }
27
+ }
28
+ ],
29
+ "metadata": {
30
+ "pact_gem": {
31
+ "version": "0.1.24"
32
+ }
33
+ }
34
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "provider": {
3
+ "name": "a provider"
4
+ },
5
+ "consumer": {
6
+ "name": "a consumer"
7
+ },
8
+ "interactions": [
9
+ {
10
+ "description": "request one",
11
+ "request": {
12
+ "method": "get",
13
+ "path": "/path_one"
14
+ },
15
+ "response": {
16
+ "status" : 200
17
+ },
18
+ "provider_state": "state one"
19
+ }
20
+ ],
21
+ "metadata": {
22
+ "pact_gem": {
23
+ "version": "0.1.24"
24
+ }
25
+ }
26
+ }
@@ -0,0 +1,78 @@
1
+ require 'hashie'
2
+ require 'hashie/extensions/key_conversion'
3
+
4
+ module Pact
5
+ module HashUtils
6
+
7
+ class Converter < Hash
8
+ include Hashie::Extensions::KeyConversion
9
+ include Hashie::Extensions::DeepMerge
10
+ end
11
+
12
+ def symbolize_keys hash
13
+ Hash[Converter[hash].symbolize_keys]
14
+ end
15
+
16
+ def stringify_keys hash
17
+ Hash[Converter[hash].stringify_keys]
18
+ end
19
+
20
+ def deep_merge hash1, hash2
21
+ Converter[hash1].deep_merge(Converter[hash2])
22
+ end
23
+ end
24
+ end
25
+
26
+ class InteractionFactory
27
+
28
+ extend Pact::HashUtils
29
+
30
+ DEFAULTS = Hash[
31
+ 'request' => {
32
+ 'path' => '/path',
33
+ 'method' => 'get',
34
+ },
35
+ 'response' => {
36
+ 'body' => {a: 'response body'}
37
+ },
38
+ 'description' => 'a description',
39
+ 'provider_state' => 'a thing exists'
40
+ ]
41
+
42
+ def self.create hash = {}
43
+ Pact::Interaction.from_hash(stringify_keys(deep_merge(DEFAULTS, stringify_keys(hash))))
44
+ end
45
+ end
46
+
47
+
48
+ class ConsumerContractFactory
49
+ extend Pact::HashUtils
50
+ DEFAULTS = {:consumer_name => 'consumer',
51
+ :provider_name => 'provider',
52
+ :interactions => [InteractionFactory.create]}
53
+
54
+ def self.create overrides = {}
55
+ options = deep_merge(symbolize_keys(DEFAULTS), symbolize_keys(overrides))
56
+ Pact::ConsumerContract.new({:consumer => Pact::ServiceConsumer.new(name: options[:consumer_name]),
57
+ :provider => Pact::ServiceProvider.new(name: options[:provider_name]),
58
+ :interactions => options[:interactions]})
59
+ end
60
+ end
61
+
62
+
63
+
64
+ class ResponseFactory
65
+ extend Pact::HashUtils
66
+ DEFAULTS = {:status => 200, :body => {a: 'body'}}.freeze
67
+ def self.create_hash overrides = {}
68
+ deep_merge(DEFAULTS, overrides)
69
+ end
70
+ end
71
+
72
+ class RequestFactory
73
+ extend Pact::HashUtils
74
+ DEFAULTS = {:path => '/path', :method => 'get'}.freeze
75
+ def self.create_hash overrides = {}
76
+ deep_merge(DEFAULTS, overrides)
77
+ end
78
+ end
@@ -12,7 +12,7 @@ module Pact
12
12
  end
13
13
  end
14
14
 
15
- Pact.service_provider "Some Producer" do
15
+ Pact.service_provider "Some Provider" do
16
16
  app { TestApp.new }
17
17
  end
18
18
 
@@ -16,7 +16,7 @@
16
16
  "body": {"message" : "this is not the weather you are looking for"}
17
17
 
18
18
  },
19
- "producer_state": "the weather is cloudy"
19
+ "provider_state": "the weather is cloudy"
20
20
  }
21
21
  ]
22
22
  }
@@ -15,7 +15,7 @@
15
15
  "headers" : {"Content-type": "application/json"},
16
16
  "body": {"message" : "sunny"}
17
17
  },
18
- "producer_state": "the weather is sunny"
18
+ "provider_state": "the weather is sunny"
19
19
  }
20
20
  ]
21
21
  }
data/tasks/pact-test.rake CHANGED
@@ -1,4 +1,4 @@
1
- require './lib/pact/producer/pact_spec_runner'
1
+ require './lib/pact/provider/pact_spec_runner'
2
2
 
3
3
  namespace :pact do
4
4
 
@@ -7,10 +7,10 @@ namespace :pact do
7
7
  puts "Running task pact:tests"
8
8
  # Run these specs silently, otherwise expected failures will be written to stdout and look like unexpected failures.
9
9
 
10
- result = Pact::Producer::PactSpecRunner.run([{ uri: './spec/support/test_app_pass.json', support_file: './spec/support/pact_rake_support.rb', consumer: 'some-test-consumer' }], silent: true)
10
+ result = Pact::Provider::PactSpecRunner.run([{ uri: './spec/support/test_app_pass.json', support_file: './spec/support/pact_rake_support.rb', consumer: 'some-test-consumer' }], silent: true)
11
11
  fail 'Expected pact to pass' unless (result == 0)
12
12
 
13
- result = Pact::Producer::PactSpecRunner.run([{ uri: './spec/support/test_app_fail.json', support_file: './spec/support/pact_rake_support.rb' }], silent: true)
13
+ result = Pact::Provider::PactSpecRunner.run([{ uri: './spec/support/test_app_fail.json', support_file: './spec/support/pact_rake_support.rb' }], silent: true)
14
14
  fail 'Expected pact to fail' if (result == 0)
15
15
 
16
16
  puts "Task pact:tests completed succesfully."
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: 0.1.37
4
+ version: 1.0.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -38,7 +38,7 @@ dependencies:
38
38
  requirements:
39
39
  - - ~>
40
40
  - !ruby/object:Gem::Version
41
- version: 2.0.5
41
+ version: '2.0'
42
42
  type: :runtime
43
43
  prerelease: false
44
44
  version_requirements: !ruby/object:Gem::Requirement
@@ -46,7 +46,7 @@ dependencies:
46
46
  requirements:
47
47
  - - ~>
48
48
  - !ruby/object:Gem::Version
49
- version: 2.0.5
49
+ version: '2.0'
50
50
  - !ruby/object:Gem::Dependency
51
51
  name: rspec
52
52
  requirement: !ruby/object:Gem::Requirement
@@ -111,22 +111,6 @@ dependencies:
111
111
  - - ~>
112
112
  - !ruby/object:Gem::Version
113
113
  version: 1.1.0
114
- - !ruby/object:Gem::Dependency
115
- name: capybara
116
- requirement: !ruby/object:Gem::Requirement
117
- none: false
118
- requirements:
119
- - - ~>
120
- - !ruby/object:Gem::Version
121
- version: 2.1.0
122
- type: :runtime
123
- prerelease: false
124
- version_requirements: !ruby/object:Gem::Requirement
125
- none: false
126
- requirements:
127
- - - ~>
128
- - !ruby/object:Gem::Version
129
- version: 2.1.0
130
114
  - !ruby/object:Gem::Dependency
131
115
  name: thor
132
116
  requirement: !ruby/object:Gem::Requirement
@@ -272,32 +256,31 @@ files:
272
256
  - lib/pact/configuration.rb
273
257
  - lib/pact/consumer.rb
274
258
  - lib/pact/consumer/app_manager.rb
275
- - lib/pact/consumer/configuration_dsl.rb
276
259
  - lib/pact/consumer/consumer_contract_builder.rb
277
260
  - lib/pact/consumer/consumer_contract_builders.rb
278
261
  - lib/pact/consumer/dsl.rb
279
- - lib/pact/consumer/interaction.rb
262
+ - lib/pact/consumer/interaction_builder.rb
263
+ - lib/pact/consumer/interactions_filter.rb
280
264
  - lib/pact/consumer/mock_service.rb
281
265
  - lib/pact/consumer/mock_service_client.rb
282
266
  - lib/pact/consumer/rspec.rb
283
- - lib/pact/consumer/run_condor.rb
284
- - lib/pact/consumer/run_mock_contract_service.rb
285
- - lib/pact/consumer/service_consumer.rb
286
- - lib/pact/consumer/service_producer.rb
267
+ - lib/pact/consumer/server.rb
287
268
  - lib/pact/consumer_contract.rb
269
+ - lib/pact/consumer_contract/consumer_contract.rb
270
+ - lib/pact/consumer_contract/interaction.rb
271
+ - lib/pact/consumer_contract/service_consumer.rb
272
+ - lib/pact/consumer_contract/service_provider.rb
288
273
  - lib/pact/json_warning.rb
289
274
  - lib/pact/logging.rb
290
275
  - lib/pact/matchers.rb
291
276
  - lib/pact/matchers/matchers.rb
292
- - lib/pact/producer.rb
293
- - lib/pact/producer/configuration_dsl.rb
294
- - lib/pact/producer/dsl.rb
295
- - lib/pact/producer/matchers.rb
296
- - lib/pact/producer/pact_spec_runner.rb
297
- - lib/pact/producer/producer_state.rb
298
- - lib/pact/producer/rspec.rb
299
- - lib/pact/producer/test_methods.rb
277
+ - lib/pact/provider.rb
278
+ - lib/pact/provider/dsl.rb
279
+ - lib/pact/provider/matchers.rb
280
+ - lib/pact/provider/pact_spec_runner.rb
281
+ - lib/pact/provider/provider_state.rb
300
282
  - lib/pact/provider/rspec.rb
283
+ - lib/pact/provider/test_methods.rb
301
284
  - lib/pact/rake_task.rb
302
285
  - lib/pact/reification.rb
303
286
  - lib/pact/request.rb
@@ -308,28 +291,33 @@ files:
308
291
  - pact.gemspec
309
292
  - scratchpad.txt
310
293
  - spec/features/consumption_spec.rb
311
- - spec/features/producer_states/zebras.rb
312
294
  - spec/features/production_spec.rb
295
+ - spec/features/provider_states/zebras.rb
313
296
  - spec/integration/pact/consumer_configuration_spec.rb
314
297
  - spec/integration/pact/provider_configuration_spec.rb
315
298
  - spec/lib/pact/configuration_spec.rb
316
299
  - spec/lib/pact/consumer/app_manager_spec.rb
317
300
  - spec/lib/pact/consumer/consumer_contract_builder_spec.rb
318
301
  - spec/lib/pact/consumer/dsl_spec.rb
319
- - spec/lib/pact/consumer/interaction_spec.rb
302
+ - spec/lib/pact/consumer/interaction_builder_spec.rb
303
+ - spec/lib/pact/consumer/interactions_spec.rb
320
304
  - spec/lib/pact/consumer/mock_service_spec.rb
321
305
  - spec/lib/pact/consumer/service_consumer_spec.rb
322
- - spec/lib/pact/consumer_contract_spec.rb
306
+ - spec/lib/pact/consumer_contract/consumer_contract_spec.rb
307
+ - spec/lib/pact/consumer_contract/interaction_spec.rb
323
308
  - spec/lib/pact/matchers/matchers_spec.rb
324
- - spec/lib/pact/producer/configuration_dsl_spec.rb
325
- - spec/lib/pact/producer/producer_state_spec.rb
326
- - spec/lib/pact/producer/rspec_spec.rb
309
+ - spec/lib/pact/provider/dsl_spec.rb
310
+ - spec/lib/pact/provider/provider_state_spec.rb
311
+ - spec/lib/pact/provider/rspec_spec.rb
327
312
  - spec/lib/pact/reification_spec.rb
328
313
  - spec/lib/pact/request_spec.rb
329
314
  - spec/lib/pact/term_spec.rb
330
315
  - spec/lib/pact/verification_task_spec.rb
331
316
  - spec/spec_helper.rb
332
317
  - spec/support/a_consumer-a_producer.json
318
+ - spec/support/a_consumer-a_provider.json
319
+ - spec/support/consumer_contract_template.json
320
+ - spec/support/factories.rb
333
321
  - spec/support/pact_rake_support.rb
334
322
  - spec/support/test_app_fail.json
335
323
  - spec/support/test_app_pass.json
@@ -361,28 +349,33 @@ specification_version: 3
361
349
  summary: Define a pact between service consumers and providers
362
350
  test_files:
363
351
  - spec/features/consumption_spec.rb
364
- - spec/features/producer_states/zebras.rb
365
352
  - spec/features/production_spec.rb
353
+ - spec/features/provider_states/zebras.rb
366
354
  - spec/integration/pact/consumer_configuration_spec.rb
367
355
  - spec/integration/pact/provider_configuration_spec.rb
368
356
  - spec/lib/pact/configuration_spec.rb
369
357
  - spec/lib/pact/consumer/app_manager_spec.rb
370
358
  - spec/lib/pact/consumer/consumer_contract_builder_spec.rb
371
359
  - spec/lib/pact/consumer/dsl_spec.rb
372
- - spec/lib/pact/consumer/interaction_spec.rb
360
+ - spec/lib/pact/consumer/interaction_builder_spec.rb
361
+ - spec/lib/pact/consumer/interactions_spec.rb
373
362
  - spec/lib/pact/consumer/mock_service_spec.rb
374
363
  - spec/lib/pact/consumer/service_consumer_spec.rb
375
- - spec/lib/pact/consumer_contract_spec.rb
364
+ - spec/lib/pact/consumer_contract/consumer_contract_spec.rb
365
+ - spec/lib/pact/consumer_contract/interaction_spec.rb
376
366
  - spec/lib/pact/matchers/matchers_spec.rb
377
- - spec/lib/pact/producer/configuration_dsl_spec.rb
378
- - spec/lib/pact/producer/producer_state_spec.rb
379
- - spec/lib/pact/producer/rspec_spec.rb
367
+ - spec/lib/pact/provider/dsl_spec.rb
368
+ - spec/lib/pact/provider/provider_state_spec.rb
369
+ - spec/lib/pact/provider/rspec_spec.rb
380
370
  - spec/lib/pact/reification_spec.rb
381
371
  - spec/lib/pact/request_spec.rb
382
372
  - spec/lib/pact/term_spec.rb
383
373
  - spec/lib/pact/verification_task_spec.rb
384
374
  - spec/spec_helper.rb
385
375
  - spec/support/a_consumer-a_producer.json
376
+ - spec/support/a_consumer-a_provider.json
377
+ - spec/support/consumer_contract_template.json
378
+ - spec/support/factories.rb
386
379
  - spec/support/pact_rake_support.rb
387
380
  - spec/support/test_app_fail.json
388
381
  - spec/support/test_app_pass.json