pact 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +1 -1
- data/CHANGELOG.md +14 -0
- data/Gemfile.lock +5 -5
- data/README.md +25 -29
- data/documentation/README.md +9 -7
- data/lib/pact/configuration.rb +83 -12
- data/lib/pact/consumer/mock_service/interaction_mismatch.rb +5 -1
- data/lib/pact/consumer/spec_hooks.rb +7 -4
- data/lib/pact/consumer/world.rb +12 -0
- data/lib/pact/consumer_contract/headers.rb +51 -0
- data/lib/pact/consumer_contract/request.rb +6 -1
- data/lib/pact/provider/configuration/service_provider_dsl.rb +6 -1
- data/lib/pact/provider/matchers/messages.rb +2 -2
- data/lib/pact/provider/rspec.rb +7 -1
- data/lib/pact/provider/rspec/backtrace_formatter.rb +30 -6
- data/lib/pact/provider/rspec/matchers.rb +9 -6
- data/lib/pact/shared/json_differ.rb +15 -0
- data/lib/pact/shared/request.rb +11 -2
- data/lib/pact/shared/text_differ.rb +14 -0
- data/lib/pact/version.rb +1 -1
- data/spec/lib/pact/configuration_spec.rb +127 -5
- data/spec/lib/pact/consumer/mock_service/interaction_mismatch_spec.rb +8 -5
- data/spec/lib/pact/consumer_contract/headers_spec.rb +107 -0
- data/spec/lib/pact/consumer_contract/request_spec.rb +9 -0
- data/spec/lib/pact/matchers/matchers_spec.rb +35 -0
- data/spec/lib/pact/provider/configuration/service_provider_dsl_spec.rb +16 -0
- data/spec/lib/pact/provider/matchers/messages_spec.rb +5 -4
- data/spec/lib/pact/provider/rspec_spec.rb +15 -11
- data/spec/lib/pact/shared/json_differ_spec.rb +36 -0
- data/spec/lib/pact/shared/request_spec.rb +25 -1
- data/spec/lib/pact/shared/text_differ_spec.rb +54 -0
- data/spec/support/pact_helper.rb +2 -0
- data/spec/support/test_app_with_right_content_type_differ.json +23 -0
- data/tasks/pact-test.rake +6 -0
- metadata +72 -30
- checksums.yaml +0 -7
- data/documentation/Testing with pact.png +0 -0
- data/documentation/best-practices.md +0 -33
- data/documentation/development-workflow.md +0 -22
- data/documentation/faq.md +0 -81
- data/documentation/provider-states.md +0 -178
- data/documentation/raq.md +0 -39
- data/documentation/terminology.md +0 -25
- data/documentation/troubleshooting.md +0 -4
- data/documentation/verifying-pacts.md +0 -106
@@ -76,6 +76,15 @@ module Pact
|
|
76
76
|
end
|
77
77
|
end
|
78
78
|
|
79
|
+
context "when the methods are the same but different case" do
|
80
|
+
let(:expected_method) { 'get' }
|
81
|
+
let(:actual_method) { 'GET' }
|
82
|
+
|
83
|
+
it "matches" do
|
84
|
+
expect(subject.matches? actual_request).to be true
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
79
88
|
context "when the paths are different" do
|
80
89
|
let(:expected_path) { '/foo' }
|
81
90
|
let(:actual_path) { '/bar' }
|
@@ -1,11 +1,46 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
require 'pact/matchers'
|
3
|
+
require 'pact/consumer_contract/headers'
|
3
4
|
|
4
5
|
module Pact::Matchers
|
5
6
|
|
6
7
|
describe Pact::Matchers do
|
7
8
|
include Pact::Matchers
|
8
9
|
|
10
|
+
# TODO this is an integration test
|
11
|
+
describe 'matching headers' do
|
12
|
+
let(:expected) { Pact::Headers.new('Content-Type' => 'application/hippo')}
|
13
|
+
|
14
|
+
context "when the headers match in a case insensitive way" do
|
15
|
+
|
16
|
+
context "when the values match" do
|
17
|
+
let(:actual) { Pact::Headers.new('CONTENT-TYPE' => 'application/hippo')}
|
18
|
+
it "returns an empty diff" do
|
19
|
+
expect(diff(expected, actual)).to be_empty
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
context "when the header values do not match" do
|
24
|
+
let(:actual) { Pact::Headers.new('CONTENT-TYPE' => 'application/alligator')}
|
25
|
+
let(:difference) { {"Content-Type" => Difference.new('application/hippo', 'application/alligator')} }
|
26
|
+
it "returns the diff" do
|
27
|
+
expect(diff(expected, actual)).to eq difference
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
context "when the headers do not match" do
|
33
|
+
|
34
|
+
let(:actual) { Pact::Headers.new('Content-Length' => '1')}
|
35
|
+
let(:difference) { {"Content-Type" => Difference.new('application/hippo', Pact::KeyNotFound.new)} }
|
36
|
+
it "returns a diff" do
|
37
|
+
expect(diff(expected, actual)).to eq difference
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
43
|
+
|
9
44
|
describe 'matching with something like' do
|
10
45
|
|
11
46
|
context 'when the actual is something like the expected' do
|
@@ -84,6 +84,22 @@ module Pact
|
|
84
84
|
end
|
85
85
|
|
86
86
|
end
|
87
|
+
|
88
|
+
describe "CONFIG_RU_APP" do
|
89
|
+
context "when a config.ru file does not exist" do
|
90
|
+
|
91
|
+
let(:path_that_does_not_exist) { './tmp/this/path/does/not/exist/probably' }
|
92
|
+
|
93
|
+
before do
|
94
|
+
allow(Pact.configuration).to receive(:config_ru_path).and_return(path_that_does_not_exist)
|
95
|
+
end
|
96
|
+
|
97
|
+
it "raises an error with some helpful text" do
|
98
|
+
expect{ ServiceProviderDSL::CONFIG_RU_APP.call }.to raise_error /Could not find config\.ru file.*#{Regexp.escape(path_that_does_not_exist)}/
|
99
|
+
end
|
100
|
+
|
101
|
+
end
|
102
|
+
end
|
87
103
|
end
|
88
104
|
|
89
105
|
end
|
@@ -9,6 +9,7 @@ module Pact
|
|
9
9
|
|
10
10
|
describe "#match_term_failure_message" do
|
11
11
|
|
12
|
+
let(:diff_formatter) { Pact::Matchers::UnixDiffFormatter }
|
12
13
|
let(:message) { "line1\nline2"}
|
13
14
|
let(:output_message) { "Actual: actual\n\n#{message}"}
|
14
15
|
let(:output_message_with_resets) { "Actual: actual\n\n#{r}line1\n#{r}line2"}
|
@@ -20,13 +21,13 @@ module Pact
|
|
20
21
|
let(:message_line_count) { message.split("\n").size }
|
21
22
|
|
22
23
|
before do
|
23
|
-
allow(
|
24
|
+
allow(diff_formatter).to receive(:call).and_return(message)
|
24
25
|
end
|
25
26
|
|
26
|
-
subject { match_term_failure_message diff, actual, color_enabled }
|
27
|
+
subject { match_term_failure_message diff, actual, diff_formatter, color_enabled }
|
27
28
|
|
28
|
-
it "creates a message using the
|
29
|
-
expect(
|
29
|
+
it "creates a message using the diff_formatter" do
|
30
|
+
expect(diff_formatter).to receive(:call).with(diff)
|
30
31
|
subject
|
31
32
|
end
|
32
33
|
|
@@ -1,51 +1,55 @@
|
|
1
|
-
require 'pact/provider/rspec'
|
2
1
|
require 'pact/provider/rspec/matchers'
|
2
|
+
require 'pact/shared/json_differ'
|
3
|
+
require 'pact/matchers/unix_diff_formatter'
|
4
|
+
|
3
5
|
|
4
6
|
describe "the match_term matcher" do
|
5
7
|
|
6
8
|
include Pact::RSpec::Matchers
|
7
9
|
|
10
|
+
let(:diff_formatter) { Pact::Matchers::UnixDiffFormatter }
|
11
|
+
|
8
12
|
it 'does not match a hash to an array' do
|
9
|
-
expect({}).to_not match_term([])
|
13
|
+
expect({}).to_not match_term([], with: Pact::JsonDiffer, diff_formatter: diff_formatter)
|
10
14
|
end
|
11
15
|
|
12
16
|
it 'does not match an array to a hash' do
|
13
|
-
expect([]).to_not match_term({})
|
17
|
+
expect([]).to_not match_term({}, with: Pact::JsonDiffer, diff_formatter: diff_formatter)
|
14
18
|
end
|
15
19
|
|
16
20
|
it 'matches regular expressions' do
|
17
|
-
expect('blah').to match_term(/[a-z]
|
21
|
+
expect('blah').to match_term(/[a-z]*/, with: Pact::JsonDiffer, diff_formatter: diff_formatter)
|
18
22
|
end
|
19
23
|
|
20
24
|
it 'matches pact terms' do
|
21
|
-
expect('wootle').to match_term Pact::Term.new(generate:'wootle', matcher:/woot../)
|
25
|
+
expect('wootle').to match_term Pact::Term.new(generate:'wootle', matcher:/woot../), with: Pact::JsonDiffer, diff_formatter: diff_formatter
|
22
26
|
end
|
23
27
|
|
24
28
|
it 'matches all elements of arrays' do
|
25
|
-
expect(['one', 'two', ['three']]).to match_term [/one/, 'two', [Pact::Term.new(generate:'three', matcher:/thr../)]]
|
29
|
+
expect(['one', 'two', ['three']]).to match_term [/one/, 'two', [Pact::Term.new(generate:'three', matcher:/thr../)]], with: Pact::JsonDiffer, diff_formatter: diff_formatter
|
26
30
|
end
|
27
31
|
|
28
32
|
it 'matches all values of hashes' do
|
29
|
-
expect({1 => 'one', 2 => 2, 3 => 'three'}).to match_term({1 => /one/, 2 => 2, 3 => Pact::Term.new(generate:'three', matcher:/thr../)})
|
33
|
+
expect({1 => 'one', 2 => 2, 3 => 'three'}).to match_term({1 => /one/, 2 => 2, 3 => Pact::Term.new(generate:'three', matcher:/thr../)}, with: Pact::JsonDiffer, diff_formatter: diff_formatter)
|
30
34
|
end
|
31
35
|
|
32
36
|
it 'matches all other objects using ==' do
|
33
|
-
expect('wootle').to match_term 'wootle'
|
37
|
+
expect('wootle').to match_term 'wootle', with: Pact::JsonDiffer, diff_formatter: diff_formatter
|
34
38
|
end
|
35
39
|
|
36
40
|
# Note: because a consumer specifies only the keys it cares about, the pact ignores keys that are returned
|
37
41
|
# by the provider, but not are not specified in the pact. This means that any hash will match an
|
38
42
|
# expected empty hash, because there is currently no way for a consumer to expect an absence of keys.
|
39
43
|
it 'is confused by an empty hash' do
|
40
|
-
expect({:hello => 'everyone'}).to match_term({})
|
44
|
+
expect({:hello => 'everyone'}).to match_term({}, with: Pact::JsonDiffer, diff_formatter: diff_formatter)
|
41
45
|
end
|
42
46
|
|
43
47
|
it 'should not be confused by an empty array' do
|
44
|
-
expect(['blah']).to_not match_term([])
|
48
|
+
expect(['blah']).to_not match_term([], with: Pact::JsonDiffer, diff_formatter: diff_formatter)
|
45
49
|
end
|
46
50
|
|
47
51
|
it "should allow matches on an array where each item in the array only contains a subset of the actual" do
|
48
|
-
expect([{name: 'Fred', age: 12}, {name: 'John', age: 13}]).to match_term([{name: 'Fred'}, {name: 'John'}])
|
52
|
+
expect([{name: 'Fred', age: 12}, {name: 'John', age: 13}]).to match_term([{name: 'Fred'}, {name: 'John'}], with: Pact::JsonDiffer, diff_formatter: diff_formatter)
|
49
53
|
end
|
50
54
|
|
51
55
|
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'pact/shared/json_differ'
|
3
|
+
|
4
|
+
module Pact
|
5
|
+
describe JsonDiffer do
|
6
|
+
|
7
|
+
describe ".call" do
|
8
|
+
|
9
|
+
let(:expected) { {'a' => 'b'} }
|
10
|
+
|
11
|
+
subject { JsonDiffer.call(expected, actual) }
|
12
|
+
|
13
|
+
context "when the actual is valid JSON" do
|
14
|
+
|
15
|
+
let(:actual) { {'a' => 'c'} }
|
16
|
+
let(:difference) { {'a' => Pact::Matchers::Difference.new('b', 'c')} }
|
17
|
+
|
18
|
+
context "when the actual does not equal the expected" do
|
19
|
+
it "parses the JSON and returns a diff" do
|
20
|
+
expect(subject).to eq(difference)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
context "when the actual equals the expected" do
|
25
|
+
let(:actual) { expected }
|
26
|
+
it "parses the JSON and returns an empty diff" do
|
27
|
+
expect(subject.any?).to be false
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
end
|
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
require 'pact/shared/request'
|
3
|
+
require 'pact/shared/key_not_found'
|
3
4
|
|
4
5
|
module Pact
|
5
6
|
|
@@ -10,7 +11,7 @@ module Pact
|
|
10
11
|
class TestRequest < Base
|
11
12
|
|
12
13
|
def self.key_not_found
|
13
|
-
|
14
|
+
Pact::KeyNotFound.new
|
14
15
|
end
|
15
16
|
|
16
17
|
end
|
@@ -82,6 +83,29 @@ module Pact
|
|
82
83
|
end
|
83
84
|
end
|
84
85
|
|
86
|
+
describe "#content_type" do
|
87
|
+
|
88
|
+
subject { TestRequest.new("get", "/something", headers, {} , "") }
|
89
|
+
context "when there are no expected headers" do
|
90
|
+
let(:headers) { Pact::KeyNotFound.new }
|
91
|
+
it "returns nil" do
|
92
|
+
expect(subject.send(:content_type)).to be nil
|
93
|
+
end
|
94
|
+
end
|
95
|
+
context "when there is no Content-Type header" do
|
96
|
+
let(:headers) { {} }
|
97
|
+
it "returns the content-type" do
|
98
|
+
expect(subject.send(:content_type)).to be nil
|
99
|
+
end
|
100
|
+
end
|
101
|
+
context "when there is a content-type header (" do
|
102
|
+
let(:headers) { {'content-type' => 'blah'} }
|
103
|
+
it "returns the content-type" do
|
104
|
+
expect(subject.send(:content_type)).to eq 'blah'
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
85
109
|
end
|
86
110
|
end
|
87
111
|
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'pact/shared/text_differ'
|
3
|
+
|
4
|
+
module Pact
|
5
|
+
describe TextDiffer do
|
6
|
+
|
7
|
+
describe ".call" do
|
8
|
+
|
9
|
+
subject { TextDiffer.call expected, actual }
|
10
|
+
|
11
|
+
let(:expected) { "This is the string you are looking for" }
|
12
|
+
|
13
|
+
context "when the expected and actual are both strings" do
|
14
|
+
|
15
|
+
context "when they equal each other" do
|
16
|
+
let(:actual) { "This is the string you are looking for" }
|
17
|
+
|
18
|
+
it "returns an empty diff" do
|
19
|
+
expect(subject.any?).to be false
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
context "when they don't equal each other" do
|
24
|
+
let(:actual) { "This is not the string you are looking for" }
|
25
|
+
|
26
|
+
it "returns the diff" do
|
27
|
+
expect(subject).to eq Pact::Matchers::Difference.new(expected, actual)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
context "when the actual is not a String" do
|
33
|
+
let(:actual) { {some: 'hash'} }
|
34
|
+
let(:difference) { Pact::Matchers::Difference.new(expected, actual)}
|
35
|
+
it "returns the diff" do
|
36
|
+
expect(subject)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
context "when the expected and actual are both objects" do
|
41
|
+
let(:actual) { {some: 'hash', blah: 'blah'} }
|
42
|
+
let(:expected) { {some: 'hash'} }
|
43
|
+
let(:difference) { Pact::Matchers::Difference.new(expected, actual)}
|
44
|
+
|
45
|
+
it "returns the diff using the JSON matching logic, allowing extra keys. But should it really if the expected Content-Type isn't actually JSON?" do
|
46
|
+
expect(subject)
|
47
|
+
end
|
48
|
+
|
49
|
+
it "potentially should treat both expected and actual as Strings"
|
50
|
+
end
|
51
|
+
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
data/spec/support/pact_helper.rb
CHANGED
@@ -11,6 +11,8 @@ module Pact
|
|
11
11
|
[200, {'Content-Type' => 'application/json'}, [{message: WEATHER[:current_state], :array => [{"foo"=> "blah"}]}.to_json]]
|
12
12
|
elsif env['PATH_INFO'] == '/sometext'
|
13
13
|
[200, {'Content-Type' => 'text/plain'}, ['some text']]
|
14
|
+
elsif env['PATH_INFO'] == '/content_type_is_important'
|
15
|
+
[200, {'Content-Type' => 'application/json'}, [{message: "A message", note: "This will cause verify to fail if it using the wrong content type differ."}.to_json]]
|
14
16
|
else
|
15
17
|
raise "unexpected path #{env['PATH_INFO']}!!!"
|
16
18
|
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
{
|
2
|
+
"consumer": {
|
3
|
+
"name": "some-test-consumer"
|
4
|
+
},
|
5
|
+
"provider": {
|
6
|
+
"name": "the test app in the pact_helper file"
|
7
|
+
},
|
8
|
+
"interactions": [
|
9
|
+
{
|
10
|
+
"description": "a test request expecting an application/json response",
|
11
|
+
"request": {
|
12
|
+
"method": "get",
|
13
|
+
"path": "/content_type_is_important",
|
14
|
+
"query": ""
|
15
|
+
},
|
16
|
+
"response": {
|
17
|
+
"status": 200,
|
18
|
+
"headers" : {"Content-type": "application/json"},
|
19
|
+
"body": {"message" : "A message"}
|
20
|
+
}
|
21
|
+
}
|
22
|
+
]
|
23
|
+
}
|
data/tasks/pact-test.rake
CHANGED
@@ -30,6 +30,10 @@ Pact::VerificationTask.new('test_app:pass') do | pact |
|
|
30
30
|
pact.uri './spec/support/test_app_pass.json'
|
31
31
|
end
|
32
32
|
|
33
|
+
Pact::VerificationTask.new('test_app:content_type') do | pact |
|
34
|
+
pact.uri './spec/support/test_app_with_right_content_type_differ.json'
|
35
|
+
end
|
36
|
+
|
33
37
|
Pact::VerificationTask.new('test_app:fail') do | pact |
|
34
38
|
pact.uri './spec/support/test_app_fail.json', pact_helper: './spec/support/pact_helper.rb'
|
35
39
|
end
|
@@ -45,6 +49,8 @@ namespace :pact do
|
|
45
49
|
Rake::Task['pact:verify'].execute
|
46
50
|
Rake::Task['pact:verify:test_app:pass'].execute
|
47
51
|
Rake::Task['pact:test:fail'].execute
|
52
|
+
Rake::Task['pact:test:pactfile'].execute
|
53
|
+
Rake::Task['pact:verify:test_app:content_type'].execute
|
48
54
|
end
|
49
55
|
|
50
56
|
desc "All the verification tests with active support loaded"
|
metadata
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pact
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- James Fraser
|
@@ -12,11 +13,12 @@ authors:
|
|
12
13
|
autorequire:
|
13
14
|
bindir: bin
|
14
15
|
cert_chain: []
|
15
|
-
date: 2014-
|
16
|
+
date: 2014-08-11 00:00:00.000000000 Z
|
16
17
|
dependencies:
|
17
18
|
- !ruby/object:Gem::Dependency
|
18
19
|
name: randexp
|
19
20
|
requirement: !ruby/object:Gem::Requirement
|
21
|
+
none: false
|
20
22
|
requirements:
|
21
23
|
- - ~>
|
22
24
|
- !ruby/object:Gem::Version
|
@@ -24,6 +26,7 @@ dependencies:
|
|
24
26
|
type: :runtime
|
25
27
|
prerelease: false
|
26
28
|
version_requirements: !ruby/object:Gem::Requirement
|
29
|
+
none: false
|
27
30
|
requirements:
|
28
31
|
- - ~>
|
29
32
|
- !ruby/object:Gem::Version
|
@@ -31,20 +34,23 @@ dependencies:
|
|
31
34
|
- !ruby/object:Gem::Dependency
|
32
35
|
name: rspec
|
33
36
|
requirement: !ruby/object:Gem::Requirement
|
37
|
+
none: false
|
34
38
|
requirements:
|
35
|
-
- - '>='
|
39
|
+
- - ! '>='
|
36
40
|
- !ruby/object:Gem::Version
|
37
41
|
version: '2.14'
|
38
42
|
type: :runtime
|
39
43
|
prerelease: false
|
40
44
|
version_requirements: !ruby/object:Gem::Requirement
|
45
|
+
none: false
|
41
46
|
requirements:
|
42
|
-
- - '>='
|
47
|
+
- - ! '>='
|
43
48
|
- !ruby/object:Gem::Version
|
44
49
|
version: '2.14'
|
45
50
|
- !ruby/object:Gem::Dependency
|
46
51
|
name: find_a_port
|
47
52
|
requirement: !ruby/object:Gem::Requirement
|
53
|
+
none: false
|
48
54
|
requirements:
|
49
55
|
- - ~>
|
50
56
|
- !ruby/object:Gem::Version
|
@@ -52,6 +58,7 @@ dependencies:
|
|
52
58
|
type: :runtime
|
53
59
|
prerelease: false
|
54
60
|
version_requirements: !ruby/object:Gem::Requirement
|
61
|
+
none: false
|
55
62
|
requirements:
|
56
63
|
- - ~>
|
57
64
|
- !ruby/object:Gem::Version
|
@@ -59,6 +66,7 @@ dependencies:
|
|
59
66
|
- !ruby/object:Gem::Dependency
|
60
67
|
name: rack-test
|
61
68
|
requirement: !ruby/object:Gem::Requirement
|
69
|
+
none: false
|
62
70
|
requirements:
|
63
71
|
- - ~>
|
64
72
|
- !ruby/object:Gem::Version
|
@@ -66,6 +74,7 @@ dependencies:
|
|
66
74
|
type: :runtime
|
67
75
|
prerelease: false
|
68
76
|
version_requirements: !ruby/object:Gem::Requirement
|
77
|
+
none: false
|
69
78
|
requirements:
|
70
79
|
- - ~>
|
71
80
|
- !ruby/object:Gem::Version
|
@@ -73,6 +82,7 @@ dependencies:
|
|
73
82
|
- !ruby/object:Gem::Dependency
|
74
83
|
name: awesome_print
|
75
84
|
requirement: !ruby/object:Gem::Requirement
|
85
|
+
none: false
|
76
86
|
requirements:
|
77
87
|
- - ~>
|
78
88
|
- !ruby/object:Gem::Version
|
@@ -80,6 +90,7 @@ dependencies:
|
|
80
90
|
type: :runtime
|
81
91
|
prerelease: false
|
82
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
none: false
|
83
94
|
requirements:
|
84
95
|
- - ~>
|
85
96
|
- !ruby/object:Gem::Version
|
@@ -87,48 +98,55 @@ dependencies:
|
|
87
98
|
- !ruby/object:Gem::Dependency
|
88
99
|
name: thor
|
89
100
|
requirement: !ruby/object:Gem::Requirement
|
101
|
+
none: false
|
90
102
|
requirements:
|
91
|
-
- - '>='
|
103
|
+
- - ! '>='
|
92
104
|
- !ruby/object:Gem::Version
|
93
105
|
version: '0'
|
94
106
|
type: :runtime
|
95
107
|
prerelease: false
|
96
108
|
version_requirements: !ruby/object:Gem::Requirement
|
109
|
+
none: false
|
97
110
|
requirements:
|
98
|
-
- - '>='
|
111
|
+
- - ! '>='
|
99
112
|
- !ruby/object:Gem::Version
|
100
113
|
version: '0'
|
101
114
|
- !ruby/object:Gem::Dependency
|
102
115
|
name: json
|
103
116
|
requirement: !ruby/object:Gem::Requirement
|
117
|
+
none: false
|
104
118
|
requirements:
|
105
|
-
- - '>='
|
119
|
+
- - ! '>='
|
106
120
|
- !ruby/object:Gem::Version
|
107
121
|
version: '0'
|
108
122
|
type: :runtime
|
109
123
|
prerelease: false
|
110
124
|
version_requirements: !ruby/object:Gem::Requirement
|
125
|
+
none: false
|
111
126
|
requirements:
|
112
|
-
- - '>='
|
127
|
+
- - ! '>='
|
113
128
|
- !ruby/object:Gem::Version
|
114
129
|
version: '0'
|
115
130
|
- !ruby/object:Gem::Dependency
|
116
131
|
name: webrick
|
117
132
|
requirement: !ruby/object:Gem::Requirement
|
133
|
+
none: false
|
118
134
|
requirements:
|
119
|
-
- - '>='
|
135
|
+
- - ! '>='
|
120
136
|
- !ruby/object:Gem::Version
|
121
137
|
version: '0'
|
122
138
|
type: :runtime
|
123
139
|
prerelease: false
|
124
140
|
version_requirements: !ruby/object:Gem::Requirement
|
141
|
+
none: false
|
125
142
|
requirements:
|
126
|
-
- - '>='
|
143
|
+
- - ! '>='
|
127
144
|
- !ruby/object:Gem::Version
|
128
145
|
version: '0'
|
129
146
|
- !ruby/object:Gem::Dependency
|
130
147
|
name: term-ansicolor
|
131
148
|
requirement: !ruby/object:Gem::Requirement
|
149
|
+
none: false
|
132
150
|
requirements:
|
133
151
|
- - ~>
|
134
152
|
- !ruby/object:Gem::Version
|
@@ -136,6 +154,7 @@ dependencies:
|
|
136
154
|
type: :runtime
|
137
155
|
prerelease: false
|
138
156
|
version_requirements: !ruby/object:Gem::Requirement
|
157
|
+
none: false
|
139
158
|
requirements:
|
140
159
|
- - ~>
|
141
160
|
- !ruby/object:Gem::Version
|
@@ -143,6 +162,7 @@ dependencies:
|
|
143
162
|
- !ruby/object:Gem::Dependency
|
144
163
|
name: rake
|
145
164
|
requirement: !ruby/object:Gem::Requirement
|
165
|
+
none: false
|
146
166
|
requirements:
|
147
167
|
- - ~>
|
148
168
|
- !ruby/object:Gem::Version
|
@@ -150,6 +170,7 @@ dependencies:
|
|
150
170
|
type: :development
|
151
171
|
prerelease: false
|
152
172
|
version_requirements: !ruby/object:Gem::Requirement
|
173
|
+
none: false
|
153
174
|
requirements:
|
154
175
|
- - ~>
|
155
176
|
- !ruby/object:Gem::Version
|
@@ -157,6 +178,7 @@ dependencies:
|
|
157
178
|
- !ruby/object:Gem::Dependency
|
158
179
|
name: webmock
|
159
180
|
requirement: !ruby/object:Gem::Requirement
|
181
|
+
none: false
|
160
182
|
requirements:
|
161
183
|
- - ~>
|
162
184
|
- !ruby/object:Gem::Version
|
@@ -164,6 +186,7 @@ dependencies:
|
|
164
186
|
type: :development
|
165
187
|
prerelease: false
|
166
188
|
version_requirements: !ruby/object:Gem::Requirement
|
189
|
+
none: false
|
167
190
|
requirements:
|
168
191
|
- - ~>
|
169
192
|
- !ruby/object:Gem::Version
|
@@ -171,20 +194,23 @@ dependencies:
|
|
171
194
|
- !ruby/object:Gem::Dependency
|
172
195
|
name: pry
|
173
196
|
requirement: !ruby/object:Gem::Requirement
|
197
|
+
none: false
|
174
198
|
requirements:
|
175
|
-
- - '>='
|
199
|
+
- - ! '>='
|
176
200
|
- !ruby/object:Gem::Version
|
177
201
|
version: '0'
|
178
202
|
type: :development
|
179
203
|
prerelease: false
|
180
204
|
version_requirements: !ruby/object:Gem::Requirement
|
205
|
+
none: false
|
181
206
|
requirements:
|
182
|
-
- - '>='
|
207
|
+
- - ! '>='
|
183
208
|
- !ruby/object:Gem::Version
|
184
209
|
version: '0'
|
185
210
|
- !ruby/object:Gem::Dependency
|
186
211
|
name: fakefs
|
187
212
|
requirement: !ruby/object:Gem::Requirement
|
213
|
+
none: false
|
188
214
|
requirements:
|
189
215
|
- - ~>
|
190
216
|
- !ruby/object:Gem::Version
|
@@ -192,6 +218,7 @@ dependencies:
|
|
192
218
|
type: :development
|
193
219
|
prerelease: false
|
194
220
|
version_requirements: !ruby/object:Gem::Requirement
|
221
|
+
none: false
|
195
222
|
requirements:
|
196
223
|
- - ~>
|
197
224
|
- !ruby/object:Gem::Version
|
@@ -199,6 +226,7 @@ dependencies:
|
|
199
226
|
- !ruby/object:Gem::Dependency
|
200
227
|
name: hashie
|
201
228
|
requirement: !ruby/object:Gem::Requirement
|
229
|
+
none: false
|
202
230
|
requirements:
|
203
231
|
- - ~>
|
204
232
|
- !ruby/object:Gem::Version
|
@@ -206,6 +234,7 @@ dependencies:
|
|
206
234
|
type: :development
|
207
235
|
prerelease: false
|
208
236
|
version_requirements: !ruby/object:Gem::Requirement
|
237
|
+
none: false
|
209
238
|
requirements:
|
210
239
|
- - ~>
|
211
240
|
- !ruby/object:Gem::Version
|
@@ -213,29 +242,33 @@ dependencies:
|
|
213
242
|
- !ruby/object:Gem::Dependency
|
214
243
|
name: activesupport
|
215
244
|
requirement: !ruby/object:Gem::Requirement
|
245
|
+
none: false
|
216
246
|
requirements:
|
217
|
-
- - '>='
|
247
|
+
- - ! '>='
|
218
248
|
- !ruby/object:Gem::Version
|
219
249
|
version: '0'
|
220
250
|
type: :development
|
221
251
|
prerelease: false
|
222
252
|
version_requirements: !ruby/object:Gem::Requirement
|
253
|
+
none: false
|
223
254
|
requirements:
|
224
|
-
- - '>='
|
255
|
+
- - ! '>='
|
225
256
|
- !ruby/object:Gem::Version
|
226
257
|
version: '0'
|
227
258
|
- !ruby/object:Gem::Dependency
|
228
259
|
name: faraday
|
229
260
|
requirement: !ruby/object:Gem::Requirement
|
261
|
+
none: false
|
230
262
|
requirements:
|
231
|
-
- - '>='
|
263
|
+
- - ! '>='
|
232
264
|
- !ruby/object:Gem::Version
|
233
265
|
version: '0'
|
234
266
|
type: :development
|
235
267
|
prerelease: false
|
236
268
|
version_requirements: !ruby/object:Gem::Requirement
|
269
|
+
none: false
|
237
270
|
requirements:
|
238
|
-
- - '>='
|
271
|
+
- - ! '>='
|
239
272
|
- !ruby/object:Gem::Version
|
240
273
|
version: '0'
|
241
274
|
description: Enables consumer driven contract testing, providing a mock service and
|
@@ -265,19 +298,10 @@ files:
|
|
265
298
|
- bin/pact
|
266
299
|
- config.ru
|
267
300
|
- documentation/README.md
|
268
|
-
- documentation/Testing with pact.png
|
269
|
-
- documentation/best-practices.md
|
270
301
|
- documentation/configuration.md
|
271
|
-
- documentation/development-workflow.md
|
272
302
|
- documentation/diff_formatter_embedded.png
|
273
303
|
- documentation/diff_formatter_list.png
|
274
304
|
- documentation/diff_formatter_unix.png
|
275
|
-
- documentation/faq.md
|
276
|
-
- documentation/provider-states.md
|
277
|
-
- documentation/raq.md
|
278
|
-
- documentation/terminology.md
|
279
|
-
- documentation/troubleshooting.md
|
280
|
-
- documentation/verifying-pacts.md
|
281
305
|
- example/animal-service/Gemfile
|
282
306
|
- example/animal-service/Gemfile.lock
|
283
307
|
- example/animal-service/Rakefile
|
@@ -338,6 +362,7 @@ files:
|
|
338
362
|
- lib/pact/consumer_contract/consumer_contract.rb
|
339
363
|
- lib/pact/consumer_contract/consumer_contract_writer.rb
|
340
364
|
- lib/pact/consumer_contract/file_name.rb
|
365
|
+
- lib/pact/consumer_contract/headers.rb
|
341
366
|
- lib/pact/consumer_contract/interaction.rb
|
342
367
|
- lib/pact/consumer_contract/pact_file.rb
|
343
368
|
- lib/pact/consumer_contract/request.rb
|
@@ -404,9 +429,11 @@ files:
|
|
404
429
|
- lib/pact/shared/active_support_support.rb
|
405
430
|
- lib/pact/shared/dsl.rb
|
406
431
|
- lib/pact/shared/jruby_support.rb
|
432
|
+
- lib/pact/shared/json_differ.rb
|
407
433
|
- lib/pact/shared/key_not_found.rb
|
408
434
|
- lib/pact/shared/null_expectation.rb
|
409
435
|
- lib/pact/shared/request.rb
|
436
|
+
- lib/pact/shared/text_differ.rb
|
410
437
|
- lib/pact/something_like.rb
|
411
438
|
- lib/pact/symbolize_keys.rb
|
412
439
|
- lib/pact/tasks.rb
|
@@ -444,6 +471,7 @@ files:
|
|
444
471
|
- spec/lib/pact/consumer_contract/active_support_support_spec.rb
|
445
472
|
- spec/lib/pact/consumer_contract/consumer_contract_spec.rb
|
446
473
|
- spec/lib/pact/consumer_contract/consumer_contract_writer_spec.rb
|
474
|
+
- spec/lib/pact/consumer_contract/headers_spec.rb
|
447
475
|
- spec/lib/pact/consumer_contract/interaction_spec.rb
|
448
476
|
- spec/lib/pact/consumer_contract/request_spec.rb
|
449
477
|
- spec/lib/pact/doc/generator_spec.rb
|
@@ -479,8 +507,10 @@ files:
|
|
479
507
|
- spec/lib/pact/provider/world_spec.rb
|
480
508
|
- spec/lib/pact/reification_spec.rb
|
481
509
|
- spec/lib/pact/shared/dsl_spec.rb
|
510
|
+
- spec/lib/pact/shared/json_differ_spec.rb
|
482
511
|
- spec/lib/pact/shared/key_not_found_spec.rb
|
483
512
|
- spec/lib/pact/shared/request_spec.rb
|
513
|
+
- spec/lib/pact/shared/text_differ_spec.rb
|
484
514
|
- spec/lib/pact/something_like_spec.rb
|
485
515
|
- spec/lib/pact/tasks/task_helper_spec.rb
|
486
516
|
- spec/lib/pact/tasks/verification_task_spec.rb
|
@@ -510,31 +540,39 @@ files:
|
|
510
540
|
- spec/support/term.json
|
511
541
|
- spec/support/test_app_fail.json
|
512
542
|
- spec/support/test_app_pass.json
|
543
|
+
- spec/support/test_app_with_right_content_type_differ.json
|
513
544
|
- tasks/pact-test.rake
|
514
545
|
- tasks/spec.rake
|
515
546
|
homepage: https://github.com/realestate-com-au/pact
|
516
547
|
licenses:
|
517
548
|
- MIT
|
518
|
-
metadata: {}
|
519
549
|
post_install_message:
|
520
550
|
rdoc_options: []
|
521
551
|
require_paths:
|
522
552
|
- lib
|
523
553
|
required_ruby_version: !ruby/object:Gem::Requirement
|
554
|
+
none: false
|
524
555
|
requirements:
|
525
|
-
- - '>='
|
556
|
+
- - ! '>='
|
526
557
|
- !ruby/object:Gem::Version
|
527
558
|
version: '0'
|
559
|
+
segments:
|
560
|
+
- 0
|
561
|
+
hash: 1965962411134089782
|
528
562
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
563
|
+
none: false
|
529
564
|
requirements:
|
530
|
-
- - '>='
|
565
|
+
- - ! '>='
|
531
566
|
- !ruby/object:Gem::Version
|
532
567
|
version: '0'
|
568
|
+
segments:
|
569
|
+
- 0
|
570
|
+
hash: 1965962411134089782
|
533
571
|
requirements: []
|
534
572
|
rubyforge_project:
|
535
|
-
rubygems_version:
|
573
|
+
rubygems_version: 1.8.23
|
536
574
|
signing_key:
|
537
|
-
specification_version:
|
575
|
+
specification_version: 3
|
538
576
|
summary: Enables consumer driven contract testing, providing a mock service and DSL
|
539
577
|
for the consumer project, and interaction playback and verification for the service
|
540
578
|
provider project.
|
@@ -565,6 +603,7 @@ test_files:
|
|
565
603
|
- spec/lib/pact/consumer_contract/active_support_support_spec.rb
|
566
604
|
- spec/lib/pact/consumer_contract/consumer_contract_spec.rb
|
567
605
|
- spec/lib/pact/consumer_contract/consumer_contract_writer_spec.rb
|
606
|
+
- spec/lib/pact/consumer_contract/headers_spec.rb
|
568
607
|
- spec/lib/pact/consumer_contract/interaction_spec.rb
|
569
608
|
- spec/lib/pact/consumer_contract/request_spec.rb
|
570
609
|
- spec/lib/pact/doc/generator_spec.rb
|
@@ -600,8 +639,10 @@ test_files:
|
|
600
639
|
- spec/lib/pact/provider/world_spec.rb
|
601
640
|
- spec/lib/pact/reification_spec.rb
|
602
641
|
- spec/lib/pact/shared/dsl_spec.rb
|
642
|
+
- spec/lib/pact/shared/json_differ_spec.rb
|
603
643
|
- spec/lib/pact/shared/key_not_found_spec.rb
|
604
644
|
- spec/lib/pact/shared/request_spec.rb
|
645
|
+
- spec/lib/pact/shared/text_differ_spec.rb
|
605
646
|
- spec/lib/pact/something_like_spec.rb
|
606
647
|
- spec/lib/pact/tasks/task_helper_spec.rb
|
607
648
|
- spec/lib/pact/tasks/verification_task_spec.rb
|
@@ -631,3 +672,4 @@ test_files:
|
|
631
672
|
- spec/support/term.json
|
632
673
|
- spec/support/test_app_fail.json
|
633
674
|
- spec/support/test_app_pass.json
|
675
|
+
- spec/support/test_app_with_right_content_type_differ.json
|