pact-support 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/pact/matchers/unix_diff_formatter.rb +3 -1
- data/lib/pact/support/version.rb +1 -1
- data/spec/lib/pact/matchers/unix_diff_formatter_spec.rb +18 -2
- metadata +37 -36
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 44e7fa13bf3c14914b74db7a436d5740ca04e7a5
|
4
|
+
data.tar.gz: 1911cc885711963bbaa6340ffe16876003501573
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a3eaca3f79ada2d3e8d39b6fbe1a51b68d3e0f39064c527cbf84ae18a64f017de38e3e24425342768d74983a64e28932c1663e69e6252a37ff3a859def85a34
|
7
|
+
data.tar.gz: e64302d6fc9a6bae6e409fbb0ecf7e9928188e770eadb4ad107d3a1475048530ec14e5e219ecefd8f22d5fd56cfcdc8888786306f0add2ae94ebfe3c27b3ce77
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,14 @@ Do this to generate your change history
|
|
2
2
|
|
3
3
|
git log --pretty=format:' * %h - %s (%an, %ad)'
|
4
4
|
|
5
|
+
### 0.1.4 (20 January 2015)
|
6
|
+
|
7
|
+
A naughty release because bumping the minor version to 0.2.0 means I have to upgrade all the gems.
|
8
|
+
|
9
|
+
### 0.2.0 (20 January 2015)
|
10
|
+
|
11
|
+
* bb5d893 - Added option to UnixDiffFormatter to not show the explanation (Beth, Tue Jan 20 08:39:42 2015 +1100)
|
12
|
+
|
5
13
|
### 0.1.3 (12 December 2014)
|
6
14
|
|
7
15
|
* 27f3625 - Fixed bug rendering no diff indicator as JSON (Beth, Fri Dec 12 10:42:50 2014 +1100)
|
@@ -11,6 +11,7 @@ module Pact
|
|
11
11
|
def initialize diff, options = {}
|
12
12
|
@diff = diff
|
13
13
|
@colour = options.fetch(:colour, false)
|
14
|
+
@include_explanation = options.fetch(:include_explanation, true)
|
14
15
|
@differ = Pact::Matchers::Differ.new(@colour)
|
15
16
|
end
|
16
17
|
|
@@ -25,7 +26,8 @@ module Pact
|
|
25
26
|
def to_s
|
26
27
|
expected = generate_string(diff, :expected)
|
27
28
|
actual = generate_string(diff, :actual)
|
28
|
-
|
29
|
+
suffix = @include_explanation ? "\n" + key : ''
|
30
|
+
@differ.diff_as_string(actual, expected).lstrip + suffix
|
29
31
|
end
|
30
32
|
|
31
33
|
private
|
data/lib/pact/support/version.rb
CHANGED
@@ -73,7 +73,7 @@ EOF
|
|
73
73
|
end
|
74
74
|
|
75
75
|
it "doesn't display the no difference indicator as a change" do
|
76
|
-
expect(subject).to match(/^\s+no difference here
|
76
|
+
expect(subject).to match(/^\s+"no difference here!",$/)
|
77
77
|
end
|
78
78
|
|
79
79
|
it "generates the right number of lines, even with ActiveSupport loaded" do
|
@@ -209,8 +209,24 @@ EOF
|
|
209
209
|
|
210
210
|
end
|
211
211
|
|
212
|
-
|
212
|
+
context "when the explanation should be included (default)" do
|
213
|
+
let(:diff) { {thing: {alligator: Difference.new({name: 'Mary'}, "Joe" )}} }
|
214
|
+
subject { UnixDiffFormatter.call(diff, {colour: colour}) }
|
215
|
+
|
216
|
+
it "appends the explanation" do
|
217
|
+
expect(subject).to include ("Key:")
|
218
|
+
end
|
219
|
+
end
|
213
220
|
|
221
|
+
context "when the explanation should not be included" do
|
222
|
+
let(:diff) { {thing: {alligator: Difference.new({name: 'Mary'}, "Joe" )}} }
|
223
|
+
subject { UnixDiffFormatter.call(diff, {colour: colour, include_explanation: false}) }
|
224
|
+
|
225
|
+
it "does not append the explanation" do
|
226
|
+
expect(subject).to_not include ("Key:")
|
227
|
+
end
|
228
|
+
end
|
229
|
+
end
|
214
230
|
end
|
215
231
|
end
|
216
232
|
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.1.
|
4
|
+
version: 0.1.4
|
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:
|
15
|
+
date: 2015-01-19 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
|
@@ -344,17 +344,17 @@ require_paths:
|
|
344
344
|
- lib
|
345
345
|
required_ruby_version: !ruby/object:Gem::Requirement
|
346
346
|
requirements:
|
347
|
-
- -
|
347
|
+
- - ">="
|
348
348
|
- !ruby/object:Gem::Version
|
349
349
|
version: '0'
|
350
350
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
351
351
|
requirements:
|
352
|
-
- -
|
352
|
+
- - ">="
|
353
353
|
- !ruby/object:Gem::Version
|
354
354
|
version: '0'
|
355
355
|
requirements: []
|
356
356
|
rubyforge_project:
|
357
|
-
rubygems_version: 2.
|
357
|
+
rubygems_version: 2.2.2
|
358
358
|
signing_key:
|
359
359
|
specification_version: 4
|
360
360
|
summary: Shared code for Pact gems
|
@@ -412,3 +412,4 @@ test_files:
|
|
412
412
|
- spec/support/test_app_fail.json
|
413
413
|
- spec/support/test_app_pass.json
|
414
414
|
- spec/support/test_app_with_right_content_type_differ.json
|
415
|
+
has_rdoc:
|