pact-support 0.4.2 → 0.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/pact/configuration.rb +8 -1
- data/lib/pact/support/version.rb +1 -1
- data/lib/pact/symbolize_keys.rb +1 -0
- data/spec/lib/pact/configuration_spec.rb +27 -0
- data/spec/lib/pact/symbolize_keys_spec.rb +15 -0
- metadata +38 -36
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4cf5825accbe433ede480455c3b665e664b590eb
|
4
|
+
data.tar.gz: 4ab036036ff9921237a7abe04c42a4cc51047347
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 528365fd336a41546452e2793ed7d9b7931d71b63c3675962a1115de03055284977d36c0902f8b31d9ea5ecdaf7233e33b5d0fa9d41030744e0885754c154972
|
7
|
+
data.tar.gz: d7fc2ab5af322a70bb84a253f841f98c961274713c349b16055f69ff121834ad1ed3b822f1d4ce858f9fbe4e7871df24afde95253e3c6a996c58cc3ed4f9f9eb
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,11 @@ Do this to generate your change history
|
|
2
2
|
|
3
3
|
git log --pretty=format:' * %h - %s (%an, %ad)'
|
4
4
|
|
5
|
+
### 0.4.3 (7 July 2015)
|
6
|
+
|
7
|
+
* cf99e97 - Handle nils when symbolizing keys in a hash (Beth Skurrie, Tue Jul 7 11:52:50 2015 +1000)
|
8
|
+
* b100ccd - Log warning when no content type is found that text diff will be performed on body (Beth Skurrie, Sun May 10 21:57:07 2015 +1000)
|
9
|
+
|
5
10
|
### 0.4.2 (9 May 2015)
|
6
11
|
|
7
12
|
* 75f98d7 - Added missing requires (Beth Skurrie, Sat May 9 16:20:07 2015 +1000)
|
data/lib/pact/configuration.rb
CHANGED
@@ -90,7 +90,14 @@ module Pact
|
|
90
90
|
end
|
91
91
|
|
92
92
|
def body_differ_for_content_type content_type
|
93
|
-
differ_registrations
|
93
|
+
differ_registrations
|
94
|
+
.find{ | registration | registration.first =~ content_type }
|
95
|
+
.tap do |it|
|
96
|
+
if content_type.nil? && it.last == Pact::TextDiffer
|
97
|
+
error_stream.puts "WARN: No content type found, performing text diff on body"
|
98
|
+
logger.warn "No content type found, performing text diff on body"
|
99
|
+
end
|
100
|
+
end.last
|
94
101
|
end
|
95
102
|
|
96
103
|
def log_path
|
data/lib/pact/support/version.rb
CHANGED
data/lib/pact/symbolize_keys.rb
CHANGED
@@ -20,5 +20,32 @@ module Pact
|
|
20
20
|
|
21
21
|
end
|
22
22
|
|
23
|
+
|
24
|
+
describe "#body_differ_for_content_type" do
|
25
|
+
context "when the Content-Type is nil" do
|
26
|
+
|
27
|
+
before do
|
28
|
+
allow(Pact.configuration.error_stream).to receive(:puts)
|
29
|
+
end
|
30
|
+
|
31
|
+
subject { Pact.configuration.body_differ_for_content_type nil }
|
32
|
+
|
33
|
+
it "returns the TextDiffer" do
|
34
|
+
expect(subject).to eq Pact::TextDiffer
|
35
|
+
end
|
36
|
+
|
37
|
+
it "logs a warning to log file" do
|
38
|
+
expect(Pact.configuration.logger).to receive(:warn).with(/No content type found/)
|
39
|
+
subject
|
40
|
+
end
|
41
|
+
|
42
|
+
it "logs a warning to the error stream" do
|
43
|
+
expect(Pact.configuration.error_stream).to receive(:puts).with(/WARN: No content type found/)
|
44
|
+
subject
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
23
50
|
end
|
24
51
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'pact/symbolize_keys'
|
2
|
+
|
3
|
+
module Pact
|
4
|
+
module SymbolizeKeys
|
5
|
+
describe "#symbolize_keys" do
|
6
|
+
context "when nil is provided" do
|
7
|
+
include Pact::SymbolizeKeys
|
8
|
+
|
9
|
+
it "returns nil" do
|
10
|
+
expect(symbolize_keys(nil)).to be nil
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pact-support
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Fraser
|
@@ -12,202 +12,202 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2015-
|
15
|
+
date: 2015-07-07 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: randexp
|
19
19
|
requirement: !ruby/object:Gem::Requirement
|
20
20
|
requirements:
|
21
|
-
- - ~>
|
21
|
+
- - "~>"
|
22
22
|
- !ruby/object:Gem::Version
|
23
23
|
version: 0.1.7
|
24
24
|
type: :runtime
|
25
25
|
prerelease: false
|
26
26
|
version_requirements: !ruby/object:Gem::Requirement
|
27
27
|
requirements:
|
28
|
-
- - ~>
|
28
|
+
- - "~>"
|
29
29
|
- !ruby/object:Gem::Version
|
30
30
|
version: 0.1.7
|
31
31
|
- !ruby/object:Gem::Dependency
|
32
32
|
name: rspec
|
33
33
|
requirement: !ruby/object:Gem::Requirement
|
34
34
|
requirements:
|
35
|
-
- -
|
35
|
+
- - ">="
|
36
36
|
- !ruby/object:Gem::Version
|
37
37
|
version: '2.14'
|
38
38
|
type: :runtime
|
39
39
|
prerelease: false
|
40
40
|
version_requirements: !ruby/object:Gem::Requirement
|
41
41
|
requirements:
|
42
|
-
- -
|
42
|
+
- - ">="
|
43
43
|
- !ruby/object:Gem::Version
|
44
44
|
version: '2.14'
|
45
45
|
- !ruby/object:Gem::Dependency
|
46
46
|
name: rack-test
|
47
47
|
requirement: !ruby/object:Gem::Requirement
|
48
48
|
requirements:
|
49
|
-
- - ~>
|
49
|
+
- - "~>"
|
50
50
|
- !ruby/object:Gem::Version
|
51
51
|
version: 0.6.2
|
52
52
|
type: :runtime
|
53
53
|
prerelease: false
|
54
54
|
version_requirements: !ruby/object:Gem::Requirement
|
55
55
|
requirements:
|
56
|
-
- - ~>
|
56
|
+
- - "~>"
|
57
57
|
- !ruby/object:Gem::Version
|
58
58
|
version: 0.6.2
|
59
59
|
- !ruby/object:Gem::Dependency
|
60
60
|
name: awesome_print
|
61
61
|
requirement: !ruby/object:Gem::Requirement
|
62
62
|
requirements:
|
63
|
-
- - ~>
|
63
|
+
- - "~>"
|
64
64
|
- !ruby/object:Gem::Version
|
65
65
|
version: '1.1'
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
68
|
version_requirements: !ruby/object:Gem::Requirement
|
69
69
|
requirements:
|
70
|
-
- - ~>
|
70
|
+
- - "~>"
|
71
71
|
- !ruby/object:Gem::Version
|
72
72
|
version: '1.1'
|
73
73
|
- !ruby/object:Gem::Dependency
|
74
74
|
name: json
|
75
75
|
requirement: !ruby/object:Gem::Requirement
|
76
76
|
requirements:
|
77
|
-
- -
|
77
|
+
- - ">="
|
78
78
|
- !ruby/object:Gem::Version
|
79
79
|
version: '0'
|
80
80
|
type: :runtime
|
81
81
|
prerelease: false
|
82
82
|
version_requirements: !ruby/object:Gem::Requirement
|
83
83
|
requirements:
|
84
|
-
- -
|
84
|
+
- - ">="
|
85
85
|
- !ruby/object:Gem::Version
|
86
86
|
version: '0'
|
87
87
|
- !ruby/object:Gem::Dependency
|
88
88
|
name: term-ansicolor
|
89
89
|
requirement: !ruby/object:Gem::Requirement
|
90
90
|
requirements:
|
91
|
-
- - ~>
|
91
|
+
- - "~>"
|
92
92
|
- !ruby/object:Gem::Version
|
93
93
|
version: '1.0'
|
94
94
|
type: :runtime
|
95
95
|
prerelease: false
|
96
96
|
version_requirements: !ruby/object:Gem::Requirement
|
97
97
|
requirements:
|
98
|
-
- - ~>
|
98
|
+
- - "~>"
|
99
99
|
- !ruby/object:Gem::Version
|
100
100
|
version: '1.0'
|
101
101
|
- !ruby/object:Gem::Dependency
|
102
102
|
name: find_a_port
|
103
103
|
requirement: !ruby/object:Gem::Requirement
|
104
104
|
requirements:
|
105
|
-
- - ~>
|
105
|
+
- - "~>"
|
106
106
|
- !ruby/object:Gem::Version
|
107
107
|
version: 1.0.1
|
108
108
|
type: :runtime
|
109
109
|
prerelease: false
|
110
110
|
version_requirements: !ruby/object:Gem::Requirement
|
111
111
|
requirements:
|
112
|
-
- - ~>
|
112
|
+
- - "~>"
|
113
113
|
- !ruby/object:Gem::Version
|
114
114
|
version: 1.0.1
|
115
115
|
- !ruby/object:Gem::Dependency
|
116
116
|
name: thor
|
117
117
|
requirement: !ruby/object:Gem::Requirement
|
118
118
|
requirements:
|
119
|
-
- -
|
119
|
+
- - ">="
|
120
120
|
- !ruby/object:Gem::Version
|
121
121
|
version: '0'
|
122
122
|
type: :runtime
|
123
123
|
prerelease: false
|
124
124
|
version_requirements: !ruby/object:Gem::Requirement
|
125
125
|
requirements:
|
126
|
-
- -
|
126
|
+
- - ">="
|
127
127
|
- !ruby/object:Gem::Version
|
128
128
|
version: '0'
|
129
129
|
- !ruby/object:Gem::Dependency
|
130
130
|
name: rake
|
131
131
|
requirement: !ruby/object:Gem::Requirement
|
132
132
|
requirements:
|
133
|
-
- - ~>
|
133
|
+
- - "~>"
|
134
134
|
- !ruby/object:Gem::Version
|
135
135
|
version: 10.0.3
|
136
136
|
type: :development
|
137
137
|
prerelease: false
|
138
138
|
version_requirements: !ruby/object:Gem::Requirement
|
139
139
|
requirements:
|
140
|
-
- - ~>
|
140
|
+
- - "~>"
|
141
141
|
- !ruby/object:Gem::Version
|
142
142
|
version: 10.0.3
|
143
143
|
- !ruby/object:Gem::Dependency
|
144
144
|
name: webmock
|
145
145
|
requirement: !ruby/object:Gem::Requirement
|
146
146
|
requirements:
|
147
|
-
- - ~>
|
147
|
+
- - "~>"
|
148
148
|
- !ruby/object:Gem::Version
|
149
149
|
version: 1.18.0
|
150
150
|
type: :development
|
151
151
|
prerelease: false
|
152
152
|
version_requirements: !ruby/object:Gem::Requirement
|
153
153
|
requirements:
|
154
|
-
- - ~>
|
154
|
+
- - "~>"
|
155
155
|
- !ruby/object:Gem::Version
|
156
156
|
version: 1.18.0
|
157
157
|
- !ruby/object:Gem::Dependency
|
158
158
|
name: pry
|
159
159
|
requirement: !ruby/object:Gem::Requirement
|
160
160
|
requirements:
|
161
|
-
- -
|
161
|
+
- - ">="
|
162
162
|
- !ruby/object:Gem::Version
|
163
163
|
version: '0'
|
164
164
|
type: :development
|
165
165
|
prerelease: false
|
166
166
|
version_requirements: !ruby/object:Gem::Requirement
|
167
167
|
requirements:
|
168
|
-
- -
|
168
|
+
- - ">="
|
169
169
|
- !ruby/object:Gem::Version
|
170
170
|
version: '0'
|
171
171
|
- !ruby/object:Gem::Dependency
|
172
172
|
name: fakefs
|
173
173
|
requirement: !ruby/object:Gem::Requirement
|
174
174
|
requirements:
|
175
|
-
- - ~>
|
175
|
+
- - "~>"
|
176
176
|
- !ruby/object:Gem::Version
|
177
177
|
version: '0.4'
|
178
178
|
type: :development
|
179
179
|
prerelease: false
|
180
180
|
version_requirements: !ruby/object:Gem::Requirement
|
181
181
|
requirements:
|
182
|
-
- - ~>
|
182
|
+
- - "~>"
|
183
183
|
- !ruby/object:Gem::Version
|
184
184
|
version: '0.4'
|
185
185
|
- !ruby/object:Gem::Dependency
|
186
186
|
name: hashie
|
187
187
|
requirement: !ruby/object:Gem::Requirement
|
188
188
|
requirements:
|
189
|
-
- - ~>
|
189
|
+
- - "~>"
|
190
190
|
- !ruby/object:Gem::Version
|
191
191
|
version: '2.0'
|
192
192
|
type: :development
|
193
193
|
prerelease: false
|
194
194
|
version_requirements: !ruby/object:Gem::Requirement
|
195
195
|
requirements:
|
196
|
-
- - ~>
|
196
|
+
- - "~>"
|
197
197
|
- !ruby/object:Gem::Version
|
198
198
|
version: '2.0'
|
199
199
|
- !ruby/object:Gem::Dependency
|
200
200
|
name: activesupport
|
201
201
|
requirement: !ruby/object:Gem::Requirement
|
202
202
|
requirements:
|
203
|
-
- -
|
203
|
+
- - ">="
|
204
204
|
- !ruby/object:Gem::Version
|
205
205
|
version: '0'
|
206
206
|
type: :development
|
207
207
|
prerelease: false
|
208
208
|
version_requirements: !ruby/object:Gem::Requirement
|
209
209
|
requirements:
|
210
|
-
- -
|
210
|
+
- - ">="
|
211
211
|
- !ruby/object:Gem::Version
|
212
212
|
version: '0'
|
213
213
|
description:
|
@@ -221,9 +221,9 @@ executables: []
|
|
221
221
|
extensions: []
|
222
222
|
extra_rdoc_files: []
|
223
223
|
files:
|
224
|
-
- .gitignore
|
225
|
-
- .rspec
|
226
|
-
- .travis.yml
|
224
|
+
- ".gitignore"
|
225
|
+
- ".rspec"
|
226
|
+
- ".travis.yml"
|
227
227
|
- CHANGELOG.md
|
228
228
|
- Gemfile
|
229
229
|
- LICENSE.txt
|
@@ -322,6 +322,7 @@ files:
|
|
322
322
|
- spec/lib/pact/shared/request_spec.rb
|
323
323
|
- spec/lib/pact/shared/text_differ_spec.rb
|
324
324
|
- spec/lib/pact/something_like_spec.rb
|
325
|
+
- spec/lib/pact/symbolize_keys_spec.rb
|
325
326
|
- spec/lib/pact/term_spec.rb
|
326
327
|
- spec/pact_specification/compliance-2.0.rb
|
327
328
|
- spec/spec_helper.rb
|
@@ -357,17 +358,17 @@ require_paths:
|
|
357
358
|
- lib
|
358
359
|
required_ruby_version: !ruby/object:Gem::Requirement
|
359
360
|
requirements:
|
360
|
-
- -
|
361
|
+
- - ">="
|
361
362
|
- !ruby/object:Gem::Version
|
362
363
|
version: '0'
|
363
364
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
364
365
|
requirements:
|
365
|
-
- -
|
366
|
+
- - ">="
|
366
367
|
- !ruby/object:Gem::Version
|
367
368
|
version: '0'
|
368
369
|
requirements: []
|
369
370
|
rubyforge_project:
|
370
|
-
rubygems_version: 2.
|
371
|
+
rubygems_version: 2.4.8
|
371
372
|
signing_key:
|
372
373
|
specification_version: 4
|
373
374
|
summary: Shared code for Pact gems
|
@@ -409,6 +410,7 @@ test_files:
|
|
409
410
|
- spec/lib/pact/shared/request_spec.rb
|
410
411
|
- spec/lib/pact/shared/text_differ_spec.rb
|
411
412
|
- spec/lib/pact/something_like_spec.rb
|
413
|
+
- spec/lib/pact/symbolize_keys_spec.rb
|
412
414
|
- spec/lib/pact/term_spec.rb
|
413
415
|
- spec/pact_specification/compliance-2.0.rb
|
414
416
|
- spec/spec_helper.rb
|