pact-support 1.11.0 → 1.12.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 +16 -0
- data/lib/pact/consumer_contract/consumer_contract.rb +11 -0
- data/lib/pact/consumer_contract/interaction.rb +4 -1
- data/lib/pact/consumer_contract/interaction_v2_parser.rb +9 -1
- data/lib/pact/consumer_contract/interaction_v3_parser.rb +10 -1
- data/lib/pact/support/version.rb +1 -1
- metadata +4 -227
- data/.github/ISSUE_TEMPLATE.md +0 -33
- data/.gitignore +0 -32
- data/.rspec +0 -3
- data/.travis.yml +0 -29
- data/Appraisals +0 -7
- data/Gemfile +0 -4
- data/RELEASING.md +0 -5
- data/Rakefile +0 -4
- data/gemfiles/default.gemfile +0 -5
- data/gemfiles/ruby_under_22.gemfile +0 -8
- data/pact-support.gemspec +0 -39
- data/script/release.sh +0 -9
- data/script/update-pact-specification-v2 +0 -9
- data/spec/fixtures/interaction-with-matching-rules.json +0 -27
- data/spec/fixtures/multipart-form-diff.txt +0 -9
- data/spec/fixtures/not-a-pact.json +0 -3
- data/spec/fixtures/pact-http-v2.json +0 -36
- data/spec/fixtures/pact-http-v3.json +0 -36
- data/spec/integration/matching_rules_extract_and_merge_spec.rb +0 -127
- data/spec/lib/pact/array_like_spec.rb +0 -37
- data/spec/lib/pact/configuration_spec.rb +0 -61
- data/spec/lib/pact/consumer/request_spec.rb +0 -25
- data/spec/lib/pact/consumer_contract/active_support_support_spec.rb +0 -58
- data/spec/lib/pact/consumer_contract/consumer_contract_spec.rb +0 -142
- data/spec/lib/pact/consumer_contract/file_name_spec.rb +0 -24
- data/spec/lib/pact/consumer_contract/headers_spec.rb +0 -107
- data/spec/lib/pact/consumer_contract/http_consumer_contract_parser_spec.rb +0 -25
- data/spec/lib/pact/consumer_contract/interaction_parser_spec.rb +0 -62
- data/spec/lib/pact/consumer_contract/interaction_spec.rb +0 -121
- data/spec/lib/pact/consumer_contract/interaction_v2_parser_spec.rb +0 -54
- data/spec/lib/pact/consumer_contract/interaction_v3_parser_spec.rb +0 -48
- data/spec/lib/pact/consumer_contract/pact_file_spec.rb +0 -204
- data/spec/lib/pact/consumer_contract/query_hash_spec.rb +0 -154
- data/spec/lib/pact/consumer_contract/query_string_spec.rb +0 -131
- data/spec/lib/pact/consumer_contract/request_spec.rb +0 -486
- data/spec/lib/pact/consumer_contract/response_spec.rb +0 -82
- data/spec/lib/pact/helpers_spec.rb +0 -143
- data/spec/lib/pact/matchers/differ_spec.rb +0 -215
- data/spec/lib/pact/matchers/difference_spec.rb +0 -22
- data/spec/lib/pact/matchers/embedded_diff_formatter_spec.rb +0 -90
- data/spec/lib/pact/matchers/extract_diff_messages_spec.rb +0 -78
- data/spec/lib/pact/matchers/index_not_found_spec.rb +0 -21
- data/spec/lib/pact/matchers/list_diff_formatter_spec.rb +0 -121
- data/spec/lib/pact/matchers/matchers_array_like_spec.rb +0 -222
- data/spec/lib/pact/matchers/matchers_messages_hash_and_array_spec.rb +0 -146
- data/spec/lib/pact/matchers/matchers_messages_mismatched_value_spec.rb +0 -72
- data/spec/lib/pact/matchers/matchers_messages_regexp_spec.rb +0 -103
- data/spec/lib/pact/matchers/matchers_spec.rb +0 -561
- data/spec/lib/pact/matchers/multipart_form_diff_formatter_spec.rb +0 -36
- data/spec/lib/pact/matchers/no_diff_at_index_spec.rb +0 -15
- data/spec/lib/pact/matchers/regexp_difference_spec.rb +0 -20
- data/spec/lib/pact/matchers/type_difference_spec.rb +0 -36
- data/spec/lib/pact/matchers/unexpected_index_spec.rb +0 -20
- data/spec/lib/pact/matchers/unexpected_key_spec.rb +0 -20
- data/spec/lib/pact/matchers/unix_diff_formatter_spec.rb +0 -235
- data/spec/lib/pact/matching_rules/extract_spec.rb +0 -216
- data/spec/lib/pact/matching_rules/merge_spec.rb +0 -436
- data/spec/lib/pact/matching_rules/v3/extract_spec.rb +0 -238
- data/spec/lib/pact/matching_rules/v3/merge_spec.rb +0 -485
- data/spec/lib/pact/matching_rules_spec.rb +0 -82
- data/spec/lib/pact/reification_spec.rb +0 -172
- data/spec/lib/pact/shared/dsl_spec.rb +0 -100
- data/spec/lib/pact/shared/form_differ_spec.rb +0 -71
- data/spec/lib/pact/shared/json_differ_spec.rb +0 -36
- data/spec/lib/pact/shared/key_not_found_spec.rb +0 -20
- data/spec/lib/pact/shared/multipart_form_differ_spec.rb +0 -49
- data/spec/lib/pact/shared/request_spec.rb +0 -235
- data/spec/lib/pact/shared/text_differ_spec.rb +0 -54
- data/spec/lib/pact/something_like_spec.rb +0 -23
- data/spec/lib/pact/support_spec.rb +0 -9
- data/spec/lib/pact/symbolize_keys_spec.rb +0 -15
- data/spec/lib/pact/term_spec.rb +0 -89
- data/spec/pact_specification/compliance-2.0.rb +0 -66
- data/spec/spec_helper.rb +0 -18
- data/spec/support/a_consumer-a_producer.json +0 -32
- data/spec/support/a_consumer-a_provider.json +0 -32
- data/spec/support/active_support_if_configured.rb +0 -6
- data/spec/support/case-insensitive-response-header-matching.json +0 -21
- data/spec/support/consumer_contract_template.json +0 -24
- data/spec/support/dsl_spec_support.rb +0 -7
- data/spec/support/factories.rb +0 -87
- data/spec/support/generated_index.md +0 -4
- data/spec/support/generated_markdown.md +0 -55
- data/spec/support/interaction_view_model.json +0 -63
- data/spec/support/interaction_view_model_with_terms.json +0 -50
- data/spec/support/markdown_pact.json +0 -48
- data/spec/support/missing_provider_states_output.txt +0 -25
- data/spec/support/options.json +0 -21
- data/spec/support/ruby_version_helpers.rb +0 -23
- data/spec/support/shared_examples_for_request.rb +0 -132
- data/spec/support/spec_support.rb +0 -29
- data/spec/support/stubbing.json +0 -22
- data/spec/support/term.json +0 -48
- data/spec/support/test_app_fail.json +0 -61
- data/spec/support/test_app_pass.json +0 -38
- data/spec/support/test_app_with_right_content_type_differ.json +0 -23
- data/tasks/release.rake +0 -5
- data/tasks/spec.rake +0 -14
data/.rspec
DELETED
data/.travis.yml
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
rvm:
|
3
|
-
- 2.0.0
|
4
|
-
- 2.1.8
|
5
|
-
- 2.2.4
|
6
|
-
- 2.3.1
|
7
|
-
- 2.4.3
|
8
|
-
- 2.5.0
|
9
|
-
- jruby-9.1.13.0
|
10
|
-
gemfile:
|
11
|
-
- gemfiles/default.gemfile
|
12
|
-
- gemfiles/ruby_under_22.gemfile
|
13
|
-
matrix:
|
14
|
-
exclude:
|
15
|
-
# rack 2.0 and activesupport 5.0 no longer support ruby under 2.2.
|
16
|
-
- rvm: 2.0.0
|
17
|
-
gemfile: gemfiles/default.gemfile
|
18
|
-
- rvm: 2.1.8
|
19
|
-
gemfile: gemfiles/default.gemfile
|
20
|
-
- rvm: 2.2.4
|
21
|
-
gemfile: gemfiles/ruby_under_22.gemfile
|
22
|
-
- rvm: 2.3.1
|
23
|
-
gemfile: gemfiles/ruby_under_22.gemfile
|
24
|
-
- rvm: 2.4.3
|
25
|
-
gemfile: gemfiles/ruby_under_22.gemfile
|
26
|
-
- rvm: 2.5.0
|
27
|
-
gemfile: gemfiles/ruby_under_22.gemfile
|
28
|
-
- rvm: jruby-9.1.13.0
|
29
|
-
gemfile: gemfiles/ruby_under_22.gemfile
|
data/Appraisals
DELETED
data/Gemfile
DELETED
data/RELEASING.md
DELETED
data/Rakefile
DELETED
data/gemfiles/default.gemfile
DELETED
data/pact-support.gemspec
DELETED
@@ -1,39 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require 'pact/support/version'
|
5
|
-
|
6
|
-
Gem::Specification.new do |gem|
|
7
|
-
gem.name = "pact-support"
|
8
|
-
gem.version = Pact::Support::VERSION
|
9
|
-
gem.authors = ["James Fraser", "Sergei Matheson", "Brent Snook", "Ronald Holshausen", "Beth Skurrie"]
|
10
|
-
gem.email = ["james.fraser@alumni.swinburne.edu", "sergei.matheson@gmail.com", "brent@fuglylogic.com", "uglyog@gmail.com", "bskurrie@dius.com.au"]
|
11
|
-
gem.summary = %q{Shared code for Pact gems}
|
12
|
-
gem.homepage = "https://github.com/bethesque/pact-support"
|
13
|
-
|
14
|
-
gem.required_ruby_version = '>= 2.0'
|
15
|
-
|
16
|
-
gem.files = `git ls-files`.split($/)
|
17
|
-
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
18
|
-
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
19
|
-
gem.require_paths = ["lib"]
|
20
|
-
gem.license = 'MIT'
|
21
|
-
|
22
|
-
gem.add_runtime_dependency 'randexp', '~> 0.1.7'
|
23
|
-
gem.add_runtime_dependency 'rspec', '>=2.14'
|
24
|
-
gem.add_runtime_dependency 'json'
|
25
|
-
gem.add_runtime_dependency 'term-ansicolor', '~> 1.0'
|
26
|
-
gem.add_runtime_dependency 'find_a_port', '~> 1.0.1'
|
27
|
-
gem.add_runtime_dependency 'thor'
|
28
|
-
gem.add_runtime_dependency 'awesome_print', '~> 1.1'
|
29
|
-
|
30
|
-
gem.add_development_dependency 'rake', '~> 10.0.3'
|
31
|
-
gem.add_development_dependency 'webmock', '~> 3.3'
|
32
|
-
gem.add_development_dependency 'pry'
|
33
|
-
gem.add_development_dependency 'fakefs', '~> 0.11.2'
|
34
|
-
gem.add_development_dependency 'hashie', '~> 2.0'
|
35
|
-
gem.add_development_dependency 'activesupport'
|
36
|
-
gem.add_development_dependency 'appraisal'
|
37
|
-
gem.add_development_dependency 'conventional-changelog', '~>1.3'
|
38
|
-
gem.add_development_dependency 'bump', '~> 0.5'
|
39
|
-
end
|
data/script/release.sh
DELETED
@@ -1,9 +0,0 @@
|
|
1
|
-
#!/bin/sh
|
2
|
-
set -e
|
3
|
-
|
4
|
-
git checkout -- lib/pact/support/version.rb
|
5
|
-
bundle exec bump ${1:-minor} --no-commit
|
6
|
-
bundle exec rake generate_changelog
|
7
|
-
git add CHANGELOG.md lib/pact/support/version.rb
|
8
|
-
git commit -m "chore(release): version $(ruby -r ./lib/pact/support/version.rb -e "puts Pact::Support::VERSION")"
|
9
|
-
bundle exec rake release
|
@@ -1,9 +0,0 @@
|
|
1
|
-
#!/bin/sh
|
2
|
-
|
3
|
-
# git remote add pact-specification git@github.com:bethesque/pact-specification.git
|
4
|
-
# git fetch pact-specification
|
5
|
-
# git subtree add --prefix spec/support/pact-specification-v2 pact-specification/version-2 --squash
|
6
|
-
|
7
|
-
git remote add pact-specification git@github.com:bethesque/pact-specification.git
|
8
|
-
git fetch pact-specification
|
9
|
-
git subtree pull --prefix spec/support/pact-specification-v2 pact-specification/version-2 --squash
|
@@ -1,27 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"description": "a request to make something",
|
3
|
-
"providerState" : null,
|
4
|
-
"request" : {
|
5
|
-
"method" : "POST",
|
6
|
-
"path" : "/something",
|
7
|
-
"body": {
|
8
|
-
"name": "Mary"
|
9
|
-
},
|
10
|
-
"matchingRules": {
|
11
|
-
"$.body.name" : {"regex" : ".+"}
|
12
|
-
}
|
13
|
-
},
|
14
|
-
"response" : {
|
15
|
-
"status" : 200,
|
16
|
-
"body" : {
|
17
|
-
"_links" : {
|
18
|
-
"self" : {
|
19
|
-
"href" : "http://localhost:1234/things/1"
|
20
|
-
}
|
21
|
-
}
|
22
|
-
},
|
23
|
-
"matchingRules" : {
|
24
|
-
"$.body._links.self.href": {"regex": "http:\\/\\/.*\\/\\d+"}
|
25
|
-
}
|
26
|
-
}
|
27
|
-
}
|
@@ -1,36 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"consumer": {
|
3
|
-
"name": "some-test-consumer"
|
4
|
-
},
|
5
|
-
"provider": {
|
6
|
-
"name": "an unknown provider"
|
7
|
-
},
|
8
|
-
"interactions": [
|
9
|
-
{
|
10
|
-
"description": "a test request",
|
11
|
-
"request": {
|
12
|
-
"method": "get",
|
13
|
-
"path": "/weather",
|
14
|
-
"query": ""
|
15
|
-
},
|
16
|
-
"response": {
|
17
|
-
"matchingRules": {
|
18
|
-
"$.headers.Content-Type" : {
|
19
|
-
"match": "regex", "regex": "json"
|
20
|
-
},
|
21
|
-
"$.body.message" : {
|
22
|
-
"match": "regex", "regex": "sun"
|
23
|
-
}
|
24
|
-
},
|
25
|
-
"status": 200,
|
26
|
-
"headers" : {
|
27
|
-
"Content-Type": "foo/json"
|
28
|
-
},
|
29
|
-
"body": {
|
30
|
-
"message" : "sunful"
|
31
|
-
}
|
32
|
-
},
|
33
|
-
"provider_state": "the weather is sunny"
|
34
|
-
}
|
35
|
-
]
|
36
|
-
}
|
@@ -1,36 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"consumer": {
|
3
|
-
"name": "consumer"
|
4
|
-
},
|
5
|
-
"interactions": [
|
6
|
-
{
|
7
|
-
"description": "a test request",
|
8
|
-
"providerState": "the weather is sunny",
|
9
|
-
"request": {
|
10
|
-
"method": "get",
|
11
|
-
"path": "/foo"
|
12
|
-
},
|
13
|
-
"response": {
|
14
|
-
"body": {
|
15
|
-
"foo": "bar"
|
16
|
-
},
|
17
|
-
"matchingRules": {
|
18
|
-
"body": {
|
19
|
-
"$.foo": {
|
20
|
-
"matchers": [{ "match": "type" }]
|
21
|
-
}
|
22
|
-
}
|
23
|
-
},
|
24
|
-
"status": 200
|
25
|
-
}
|
26
|
-
}
|
27
|
-
],
|
28
|
-
"provider": {
|
29
|
-
"name": "provider"
|
30
|
-
},
|
31
|
-
"metadata": {
|
32
|
-
"pactSpecification": {
|
33
|
-
"version": "3.0"
|
34
|
-
}
|
35
|
-
}
|
36
|
-
}
|
@@ -1,127 +0,0 @@
|
|
1
|
-
require 'pact/term'
|
2
|
-
require 'pact/something_like'
|
3
|
-
require 'pact/matching_rules/extract'
|
4
|
-
require 'pact/matching_rules/v3/extract'
|
5
|
-
require 'pact/matching_rules/merge'
|
6
|
-
require 'pact/matching_rules/v3/merge'
|
7
|
-
require 'pact/reification'
|
8
|
-
|
9
|
-
describe "converting Pact::Term and Pact::SomethingLike to matching rules and back again" do
|
10
|
-
|
11
|
-
let(:example) { Pact::Reification.from_term expected }
|
12
|
-
let(:matching_rules) { Pact::MatchingRules::Extract.(expected) }
|
13
|
-
let(:recreated_expected) { Pact::MatchingRules::Merge.(example, matching_rules)}
|
14
|
-
|
15
|
-
let(:recreated_expected_v3) { Pact::MatchingRules::V3::Merge.(example, matching_rules_v3) }
|
16
|
-
let(:matching_rules_v3) { Pact::MatchingRules::V3::Extract.(expected) }
|
17
|
-
|
18
|
-
context "with a Pact::Term" do
|
19
|
-
let(:expected) do
|
20
|
-
{
|
21
|
-
body: {
|
22
|
-
alligator: {
|
23
|
-
name: Pact::Term.new(generate: 'Mary', matcher: /M/)
|
24
|
-
}
|
25
|
-
}
|
26
|
-
}
|
27
|
-
end
|
28
|
-
|
29
|
-
it "recreates the same object hierarchy with v2 matching" do
|
30
|
-
expect(recreated_expected).to eq expected
|
31
|
-
end
|
32
|
-
|
33
|
-
it "recreates the same object hierarchy with v3 matching" do
|
34
|
-
expect(recreated_expected_v3).to eq expected
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
context "with a Pact::SomethingLike containing a Pact::ArrayLike" do
|
39
|
-
let(:expected) do
|
40
|
-
{
|
41
|
-
body: Pact::SomethingLike.new(children: Pact::ArrayLike.new("foo", min: 2))
|
42
|
-
}
|
43
|
-
end
|
44
|
-
|
45
|
-
it "recreates the same object hierarchy with v2 matching" do
|
46
|
-
expect(recreated_expected).to eq expected
|
47
|
-
end
|
48
|
-
|
49
|
-
it "recreates the same object hierarchy with v3 matching" do
|
50
|
-
expect(recreated_expected_v3).to eq expected
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
context "with a Pact::SomethingLike" do
|
55
|
-
let(:expected) do
|
56
|
-
{
|
57
|
-
body: {
|
58
|
-
alligator: {
|
59
|
-
name: Pact::SomethingLike.new("Mary")
|
60
|
-
}
|
61
|
-
}
|
62
|
-
}
|
63
|
-
end
|
64
|
-
|
65
|
-
it "recreates the same object hierarchy with v2 matching" do
|
66
|
-
expect(recreated_expected).to eq expected
|
67
|
-
end
|
68
|
-
|
69
|
-
it "recreates the same object hierarchy with v3 matching" do
|
70
|
-
expect(recreated_expected_v3).to eq expected
|
71
|
-
end
|
72
|
-
end
|
73
|
-
|
74
|
-
context "with a Pact::SomethingLike containing a Hash" do
|
75
|
-
let(:expected) do
|
76
|
-
{
|
77
|
-
body: {
|
78
|
-
alligator: Pact::SomethingLike.new(name: 'Mary')
|
79
|
-
}
|
80
|
-
}
|
81
|
-
end
|
82
|
-
|
83
|
-
let(:similar) do
|
84
|
-
{
|
85
|
-
body: {
|
86
|
-
alligator: {
|
87
|
-
name: Pact::SomethingLike.new('Mary')
|
88
|
-
}
|
89
|
-
}
|
90
|
-
}
|
91
|
-
end
|
92
|
-
|
93
|
-
it "recreates the same object hierarchy with v2 matching" do
|
94
|
-
expect(recreated_expected).to eq expected
|
95
|
-
end
|
96
|
-
|
97
|
-
it "recreates the same object hierarchy with v3 matching" do
|
98
|
-
expect(recreated_expected_v3).to eq expected
|
99
|
-
end
|
100
|
-
end
|
101
|
-
|
102
|
-
context "with a Pact::SomethingLike containing an Array" do
|
103
|
-
let(:expected) do
|
104
|
-
{
|
105
|
-
body: {
|
106
|
-
alligators: Pact::SomethingLike.new(["Mary", "Betty"])
|
107
|
-
}
|
108
|
-
}
|
109
|
-
end
|
110
|
-
|
111
|
-
let(:similar) do
|
112
|
-
{
|
113
|
-
body: {
|
114
|
-
alligators: [Pact::SomethingLike.new("Mary"), Pact::SomethingLike.new("Betty")]
|
115
|
-
}
|
116
|
-
}
|
117
|
-
end
|
118
|
-
|
119
|
-
it "recreates the same object hierarchy with v2 matching" do
|
120
|
-
expect(recreated_expected).to eq expected
|
121
|
-
end
|
122
|
-
|
123
|
-
it "recreates the same object hierarchy with v3 matching" do
|
124
|
-
expect(recreated_expected_v3).to eq expected
|
125
|
-
end
|
126
|
-
end
|
127
|
-
end
|
@@ -1,37 +0,0 @@
|
|
1
|
-
require 'pact/array_like'
|
2
|
-
|
3
|
-
module Pact
|
4
|
-
describe ArrayLike do
|
5
|
-
|
6
|
-
describe "#eq" do
|
7
|
-
subject { ArrayLike.new({name: 'Fred'}, {min: 3}) }
|
8
|
-
context "when the contents and min are the same" do
|
9
|
-
let(:other) { ArrayLike.new({name: 'Fred'}, {min: 3}) }
|
10
|
-
it "returns true" do
|
11
|
-
expect(subject).to eq other
|
12
|
-
end
|
13
|
-
|
14
|
-
end
|
15
|
-
context "when the contents are different" do
|
16
|
-
let(:other) { ArrayLike.new({name: 'John'}, {min: 3}) }
|
17
|
-
it "returns false" do
|
18
|
-
expect(subject).to_not eq other
|
19
|
-
end
|
20
|
-
end
|
21
|
-
context "when the min is different" do
|
22
|
-
let(:other) { ArrayLike.new({name: 'Fred'}, {min: 1}) }
|
23
|
-
it "returns false" do
|
24
|
-
expect(subject).to_not eq other
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
subject { ArrayLike.new({name: Pact::Term.new(generate: 'Fred', matcher: /F/)}, {min: 2}) }
|
30
|
-
|
31
|
-
describe "#generate" do
|
32
|
-
it "creates an array with the reified example" do
|
33
|
-
expect(subject.generate).to eq [{name: 'Fred'},{name: 'Fred'}]
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
@@ -1,61 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'pact/configuration'
|
3
|
-
|
4
|
-
module Pact
|
5
|
-
|
6
|
-
describe Configuration do
|
7
|
-
|
8
|
-
subject { Configuration.default_configuration }
|
9
|
-
|
10
|
-
describe "#color_enabled" do
|
11
|
-
|
12
|
-
it "sets color_enabled to be true by default" do
|
13
|
-
expect(subject.color_enabled).to be true
|
14
|
-
end
|
15
|
-
|
16
|
-
it "allows configuration of colour_enabled" do
|
17
|
-
subject.color_enabled = false
|
18
|
-
expect(subject.color_enabled).to be false
|
19
|
-
end
|
20
|
-
|
21
|
-
end
|
22
|
-
|
23
|
-
describe "#pactfile_write_order" do
|
24
|
-
it "sets pactfile_write_order to chronological by default" do
|
25
|
-
expect(subject.pactfile_write_order).to eq(:chronological)
|
26
|
-
end
|
27
|
-
|
28
|
-
it "allows configuration of pactfile_write_order" do
|
29
|
-
subject.pactfile_write_order = :alphabetical
|
30
|
-
expect(subject.pactfile_write_order).to eq(:alphabetical)
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
describe "#body_differ_for_content_type" do
|
35
|
-
context "when the Content-Type is nil" do
|
36
|
-
|
37
|
-
before do
|
38
|
-
allow(Pact.configuration.error_stream).to receive(:puts)
|
39
|
-
end
|
40
|
-
|
41
|
-
subject { Pact.configuration.body_differ_for_content_type nil }
|
42
|
-
|
43
|
-
it "returns the TextDiffer" do
|
44
|
-
expect(subject).to eq Pact::TextDiffer
|
45
|
-
end
|
46
|
-
|
47
|
-
it "logs a warning to log file" do
|
48
|
-
expect(Pact.configuration.logger).to receive(:warn).with(/No content type found/)
|
49
|
-
subject
|
50
|
-
end
|
51
|
-
|
52
|
-
it "logs a warning to the error stream" do
|
53
|
-
expect(Pact.configuration.error_stream).to receive(:puts).with(/WARN: No content type found/)
|
54
|
-
subject
|
55
|
-
end
|
56
|
-
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
|
-
end
|
61
|
-
end
|