pact-support 0.5.1 → 0.5.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 +8 -0
- data/lib/pact/helpers.rb +12 -0
- data/lib/pact/reification.rb +1 -1
- data/lib/pact/support/version.rb +1 -1
- data/spec/lib/pact/helpers_spec.rb +33 -0
- data/spec/lib/pact/reification_spec.rb +12 -0
- metadata +36 -36
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2282f09de813944168d8ff5f28aa154553519c88
|
4
|
+
data.tar.gz: f0e9d05cb208511af75e64af45dedd3e69a945ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b1832013c2276159f94c7a0f57b5a8f5ed6f9562a7c0d54bd054517301f5672cc299adb129092970529ae50958984f9867bda6e8ef019a64be7fca10b8783fc6
|
7
|
+
data.tar.gz: 750cecfbee168962f8b2099a484ec947c485560f735ccb81ea8bc70a35a906d1d18d00bd7807d46e77ba11ac19c68a9b514326bec8828f88a80e71b608768884
|
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.5.3 (8 September 2015)
|
6
|
+
|
7
|
+
* c7b1454 - Apply reification to ArrayLike flexible matcher. (Matt Fellows, Tue Sep 8 11:35:32 2015 +1000)
|
8
|
+
|
9
|
+
### 0.5.2 (13 August 2015)
|
10
|
+
|
11
|
+
* cb88842 - Add shortcuts like_uuid, like_datetime, like_date (Alex Malkov, Thu Aug 13 09:34:23 2015 +0100)
|
12
|
+
|
5
13
|
### 0.5.1 (19 July 2015)
|
6
14
|
|
7
15
|
* bd24aff - Remove rspec require from pact/support.rb to stop rspec's let method overriding minitest's let method (Beth Skurrie, Sun Jul 19 07:49:15 2015 +1000)
|
data/lib/pact/helpers.rb
CHANGED
@@ -29,5 +29,17 @@ module Pact
|
|
29
29
|
Pact::ArrayLike.new(content, options)
|
30
30
|
end
|
31
31
|
|
32
|
+
def like_uuid uuid
|
33
|
+
Pact::Term.new(generate: uuid, matcher: /^[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}$/)
|
34
|
+
end
|
35
|
+
|
36
|
+
def like_datetime datetime
|
37
|
+
Pact::Term.new(generate: datetime, matcher: /^\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)$/)
|
38
|
+
end
|
39
|
+
|
40
|
+
def like_date date
|
41
|
+
Pact::Term.new(generate: date, matcher: /^\d{4}-[01]\d-[0-3]\d$/)
|
42
|
+
end
|
43
|
+
|
32
44
|
end
|
33
45
|
end
|
data/lib/pact/reification.rb
CHANGED
data/lib/pact/support/version.rb
CHANGED
@@ -44,5 +44,38 @@ module Pact
|
|
44
44
|
expect(each_like(1, min: 2)).to eq Pact::ArrayLike.new(1, min: 2)
|
45
45
|
end
|
46
46
|
end
|
47
|
+
|
48
|
+
describe "#like_uuid" do
|
49
|
+
let(:uuid) { '11111111-2222-3333-4444-000000000000' }
|
50
|
+
|
51
|
+
it "creates a Pact::Term with UUID matcher" do
|
52
|
+
expect(like_uuid(uuid)).to eq Pact::Term.new(
|
53
|
+
generate: uuid,
|
54
|
+
matcher: /^[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}$/
|
55
|
+
)
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
describe "#like_datetime" do
|
60
|
+
let(:datetime) { '2015-08-06T16:53:10+01:00' }
|
61
|
+
|
62
|
+
it "creates a Pact::Term with UUID matcher" do
|
63
|
+
expect(like_datetime(datetime)).to eq Pact::Term.new(
|
64
|
+
generate: datetime,
|
65
|
+
matcher: /^\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)$/
|
66
|
+
)
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
describe "#like_date" do
|
71
|
+
let(:date) { '2015-08-06' }
|
72
|
+
|
73
|
+
it "creates a Pact::Term with UUID matcher" do
|
74
|
+
expect(like_date(date)).to eq Pact::Term.new(
|
75
|
+
generate: date,
|
76
|
+
matcher: /^\d{4}-[01]\d-[0-3]\d$/
|
77
|
+
)
|
78
|
+
end
|
79
|
+
end
|
47
80
|
end
|
48
81
|
end
|
@@ -63,6 +63,18 @@ module Pact
|
|
63
63
|
|
64
64
|
end
|
65
65
|
|
66
|
+
context "when ArrayLike" do
|
67
|
+
|
68
|
+
let(:request) { Pact::ArrayLike.new({a: 'String'}, {min: 3})}
|
69
|
+
|
70
|
+
subject { Reification.from_term(request)}
|
71
|
+
|
72
|
+
it "returns the contents of the ArrayLike" do
|
73
|
+
expect(subject).to eq([{a: 'String'}, {a: 'String'}, {a: 'String'}])
|
74
|
+
end
|
75
|
+
|
76
|
+
end
|
77
|
+
|
66
78
|
context "when Query" do
|
67
79
|
|
68
80
|
let(:query) { QueryString.new(Pact::Term.new(generate: "param=thing", matcher: /param=.*/)) }
|
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.5.
|
4
|
+
version: 0.5.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-09-08 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
|
@@ -363,17 +363,17 @@ require_paths:
|
|
363
363
|
- lib
|
364
364
|
required_ruby_version: !ruby/object:Gem::Requirement
|
365
365
|
requirements:
|
366
|
-
- -
|
366
|
+
- - ">="
|
367
367
|
- !ruby/object:Gem::Version
|
368
368
|
version: '0'
|
369
369
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
370
370
|
requirements:
|
371
|
-
- -
|
371
|
+
- - ">="
|
372
372
|
- !ruby/object:Gem::Version
|
373
373
|
version: '0'
|
374
374
|
requirements: []
|
375
375
|
rubyforge_project:
|
376
|
-
rubygems_version: 2.
|
376
|
+
rubygems_version: 2.4.5
|
377
377
|
signing_key:
|
378
378
|
specification_version: 4
|
379
379
|
summary: Shared code for Pact gems
|