pact 0.1.28 → 0.1.35
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.
- data/Gemfile.lock +5 -5
- data/README.md +52 -53
- data/example/zoo-app/Gemfile +15 -0
- data/example/zoo-app/Gemfile.lock +77 -0
- data/example/zoo-app/lib/zoo_app/animal_service_client.rb +36 -0
- data/example/zoo-app/lib/zoo_app/models/alligator.rb +15 -0
- data/example/zoo-app/spec/pacts/zoo_app-animal_service.json +100 -0
- data/example/zoo-app/spec/service_providers/animal_service_spec.rb +92 -0
- data/example/zoo-app/spec/service_providers/pact_helper.rb +11 -0
- data/example/zoo-app/spec/spec_helper.rb +8 -0
- data/lib/pact/consumer/configuration_dsl.rb +2 -0
- data/lib/pact/consumer/consumer_contract_builder.rb +13 -12
- data/lib/pact/consumer/dsl.rb +51 -2
- data/lib/pact/consumer/interaction.rb +15 -12
- data/lib/pact/consumer/mock_service.rb +31 -9
- data/lib/pact/consumer/mock_service_client.rb +47 -0
- data/lib/pact/consumer/rspec.rb +2 -1
- data/lib/pact/consumer_contract.rb +2 -1
- data/lib/pact/matchers/matchers.rb +59 -18
- data/lib/pact/producer/dsl.rb +61 -0
- data/lib/pact/producer/producer_state.rb +7 -0
- data/lib/pact/producer/rspec.rb +2 -0
- data/lib/pact/provider/rspec.rb +1 -0
- data/lib/pact/request.rb +42 -6
- data/lib/pact/verification_task.rb +2 -5
- data/lib/pact/version.rb +1 -1
- data/spec/features/consumption_spec.rb +56 -18
- data/spec/features/production_spec.rb +7 -16
- data/spec/integration/pact/consumer_configuration_spec.rb +144 -0
- data/spec/integration/pact/provider_configuration_spec.rb +24 -0
- data/spec/lib/pact/consumer/consumer_contract_builder_spec.rb +13 -13
- data/spec/lib/pact/consumer/dsl_spec.rb +1 -0
- data/spec/lib/pact/consumer/interaction_spec.rb +34 -0
- data/spec/lib/pact/consumer_contract_spec.rb +13 -2
- data/spec/lib/pact/matchers/matchers_spec.rb +32 -12
- data/spec/lib/pact/producer/rspec_spec.rb +1 -1
- data/spec/lib/pact/request_spec.rb +43 -1
- data/spec/support/pact_rake_support.rb +5 -8
- metadata +17 -10
- data/spec/integration/pact/configuration_spec.rb +0 -65
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.
|
4
|
+
version: 0.1.35
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ authors:
|
|
13
13
|
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
|
-
date: 2013-08-
|
16
|
+
date: 2013-08-27 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: randexp
|
@@ -259,6 +259,14 @@ files:
|
|
259
259
|
- README.md
|
260
260
|
- Rakefile
|
261
261
|
- bin/pact
|
262
|
+
- example/zoo-app/Gemfile
|
263
|
+
- example/zoo-app/Gemfile.lock
|
264
|
+
- example/zoo-app/lib/zoo_app/animal_service_client.rb
|
265
|
+
- example/zoo-app/lib/zoo_app/models/alligator.rb
|
266
|
+
- example/zoo-app/spec/pacts/zoo_app-animal_service.json
|
267
|
+
- example/zoo-app/spec/service_providers/animal_service_spec.rb
|
268
|
+
- example/zoo-app/spec/service_providers/pact_helper.rb
|
269
|
+
- example/zoo-app/spec/spec_helper.rb
|
262
270
|
- lib/pact.rb
|
263
271
|
- lib/pact/app.rb
|
264
272
|
- lib/pact/configuration.rb
|
@@ -270,6 +278,7 @@ files:
|
|
270
278
|
- lib/pact/consumer/dsl.rb
|
271
279
|
- lib/pact/consumer/interaction.rb
|
272
280
|
- lib/pact/consumer/mock_service.rb
|
281
|
+
- lib/pact/consumer/mock_service_client.rb
|
273
282
|
- lib/pact/consumer/rspec.rb
|
274
283
|
- lib/pact/consumer/run_condor.rb
|
275
284
|
- lib/pact/consumer/run_mock_contract_service.rb
|
@@ -282,11 +291,13 @@ files:
|
|
282
291
|
- lib/pact/matchers/matchers.rb
|
283
292
|
- lib/pact/producer.rb
|
284
293
|
- lib/pact/producer/configuration_dsl.rb
|
294
|
+
- lib/pact/producer/dsl.rb
|
285
295
|
- lib/pact/producer/matchers.rb
|
286
296
|
- lib/pact/producer/pact_spec_runner.rb
|
287
297
|
- lib/pact/producer/producer_state.rb
|
288
298
|
- lib/pact/producer/rspec.rb
|
289
299
|
- lib/pact/producer/test_methods.rb
|
300
|
+
- lib/pact/provider/rspec.rb
|
290
301
|
- lib/pact/rake_task.rb
|
291
302
|
- lib/pact/reification.rb
|
292
303
|
- lib/pact/request.rb
|
@@ -299,7 +310,8 @@ files:
|
|
299
310
|
- spec/features/consumption_spec.rb
|
300
311
|
- spec/features/producer_states/zebras.rb
|
301
312
|
- spec/features/production_spec.rb
|
302
|
-
- spec/integration/pact/
|
313
|
+
- spec/integration/pact/consumer_configuration_spec.rb
|
314
|
+
- spec/integration/pact/provider_configuration_spec.rb
|
303
315
|
- spec/lib/pact/configuration_spec.rb
|
304
316
|
- spec/lib/pact/consumer/app_manager_spec.rb
|
305
317
|
- spec/lib/pact/consumer/consumer_contract_builder_spec.rb
|
@@ -335,18 +347,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
335
347
|
- - ! '>='
|
336
348
|
- !ruby/object:Gem::Version
|
337
349
|
version: '0'
|
338
|
-
segments:
|
339
|
-
- 0
|
340
|
-
hash: -3049906681696067257
|
341
350
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
342
351
|
none: false
|
343
352
|
requirements:
|
344
353
|
- - ! '>='
|
345
354
|
- !ruby/object:Gem::Version
|
346
355
|
version: '0'
|
347
|
-
segments:
|
348
|
-
- 0
|
349
|
-
hash: -3049906681696067257
|
350
356
|
requirements: []
|
351
357
|
rubyforge_project:
|
352
358
|
rubygems_version: 1.8.25
|
@@ -357,7 +363,8 @@ test_files:
|
|
357
363
|
- spec/features/consumption_spec.rb
|
358
364
|
- spec/features/producer_states/zebras.rb
|
359
365
|
- spec/features/production_spec.rb
|
360
|
-
- spec/integration/pact/
|
366
|
+
- spec/integration/pact/consumer_configuration_spec.rb
|
367
|
+
- spec/integration/pact/provider_configuration_spec.rb
|
361
368
|
- spec/lib/pact/configuration_spec.rb
|
362
369
|
- spec/lib/pact/consumer/app_manager_spec.rb
|
363
370
|
- spec/lib/pact/consumer/consumer_contract_builder_spec.rb
|
@@ -1,65 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'pact/configuration'
|
3
|
-
require 'pact/consumer/dsl'
|
4
|
-
require 'pact/consumer/configuration_dsl'
|
5
|
-
require 'pact/producer/configuration_dsl'
|
6
|
-
|
7
|
-
describe "configure" do
|
8
|
-
|
9
|
-
before do
|
10
|
-
Pact.clear_configuration
|
11
|
-
Pact::Consumer::AppManager.instance.clear_all
|
12
|
-
|
13
|
-
Pact.configure do | config |
|
14
|
-
config.consumer do
|
15
|
-
name "My Consumer"
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
Pact.with_producer "My Service" do
|
20
|
-
mock_service :my_service do
|
21
|
-
port 1234
|
22
|
-
standalone true
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
Pact.with_producer "My Other Service" do
|
27
|
-
mock_service :my_other_service do
|
28
|
-
port 1235
|
29
|
-
standalone false
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
describe "configuration" do
|
35
|
-
it "should return the same configuration object each time" do
|
36
|
-
expect(Pact.configuration).to equal(Pact.configuration)
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
describe "consumer" do
|
41
|
-
it "should be configured" do
|
42
|
-
Pact.configuration.consumer.name.should eq "My Consumer"
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
describe "producers" do
|
47
|
-
include Pact::Consumer::ConsumerContractBuilders
|
48
|
-
|
49
|
-
it "should have defined methods in MockServices for the producers" do
|
50
|
-
my_service.should be_instance_of Pact::Consumer::ConsumerContractBuilder
|
51
|
-
end
|
52
|
-
|
53
|
-
context "when standalone is true" do
|
54
|
-
it "is not registerd with the AppManager" do
|
55
|
-
Pact::Consumer::AppManager.instance.app_registered_on?(1234).should be_false
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|
59
|
-
context "when standalone is false" do
|
60
|
-
it "should register the MockServices on their given ports if they are not" do
|
61
|
-
Pact::Consumer::AppManager.instance.app_registered_on?(1235).should be_true
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
65
|
-
end
|