pact 1.2.1.rc2 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 344262ac8b4cc83241621231547e801f20ee20b7
4
+ data.tar.gz: 0f66fdec5c968b3711a2b1c2ea701ddcc189d7e6
5
+ SHA512:
6
+ metadata.gz: 64836e31b92b54c0d9f1edf75ada165b57fa646d45467872b6561721c4fd963176d52c7dab8474bd0490a2b33de418a57b82292fcb8adcf72fb64dade0c7ff2b
7
+ data.tar.gz: 6877c4151371466b579ad644866b96a88cfd24acc416583cf47ff45ad173f90de629f677b655e5d2f20594bf91f0bb68642ca706b385ebb58138cc77b02b4359
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
+ ### 1.3.0 (18 June 2014)
6
+
7
+ * ea79190 - Modifying (cough*monkeypatching*cough) RSpec::Core::BacktraceFormatter as RSpec3 has some hardcoded exclusion patterns that result in *all* the backtrace lines being shown when pact:verify fails. (bethesque, Wed Jun 18 13:02:38 2014 +1000)
8
+ * 0fd2bb2 - Support objects that return valid URI strings through to_s (Gabriel Rotbart, Fri Jun 13 14:34:03 2014 +1000)
9
+
5
10
  ### 1.2.1.rc2 (13 June 2014)
6
11
 
7
12
  * d805f35 - Ensuring the pact RSpec formatter works for both rspec 2 and rspec 3 (Beth, Fri Jun 13 16:27:01 2014 +1000)
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pact (1.2.1.rc2)
4
+ pact (1.3.0)
5
5
  awesome_print (~> 1.1)
6
6
  find_a_port (~> 1.0.1)
7
7
  json
@@ -50,9 +50,9 @@ GEM
50
50
  rspec-core (~> 3.0.0)
51
51
  rspec-expectations (~> 3.0.0)
52
52
  rspec-mocks (~> 3.0.0)
53
- rspec-core (3.0.0)
53
+ rspec-core (3.0.1)
54
54
  rspec-support (~> 3.0.0)
55
- rspec-expectations (3.0.0)
55
+ rspec-expectations (3.0.1)
56
56
  diff-lcs (>= 1.2.0, < 2.0)
57
57
  rspec-support (~> 3.0.0)
58
58
  rspec-mocks (3.0.1)
@@ -2,7 +2,18 @@
2
2
 
3
3
  Provider states allow you to set up data on the provider before the interaction is run, so that it can make a response that matches what the consumer expects. It also allows the consumer to make the same request with different expected responses.
4
4
 
5
- Keep in mind that a provider state is all about the state of the *provider* (eg. what data is there), not about the state of the consumer or the request.
5
+ Keep in mind that a provider state is all about the state of the *provider* (eg. what data is there, how it is going to handle a given response), not about the state of the consumer, or about what is in the request.
6
+
7
+ The text in the provider state should make sense when you read it as follows (this is how the autogenerated documentation reads):
8
+
9
+
10
+ Given **an alligator with the name Mary exists** \*
11
+ Upon receiving **a request to retrieve an alligator by name** \*\* from Some Consumer
12
+ With {"method" : "get", "path" : "/alligators/Mary" }
13
+ Some Provider will respond with { "status" : 200, ...}
14
+
15
+ \* This is the provider state
16
+ \*\* This is the request description
6
17
 
7
18
  ### Consumer codebase
8
19
 
@@ -5,9 +5,9 @@ module Pact
5
5
  extend self
6
6
 
7
7
  def read uri, options = {}
8
- pact = open(uri) { | file | file.read }
8
+ pact = open(uri.to_s) { | file | file.read }
9
9
  if options[:save_pactfile_to_tmp]
10
- save_pactfile_to_tmp pact, ::File.basename(uri)
10
+ save_pactfile_to_tmp pact, ::File.basename(uri.to_s)
11
11
  end
12
12
  pact
13
13
  rescue StandardError => e
@@ -50,11 +50,13 @@ module Pact
50
50
  end
51
51
 
52
52
  def configure_rspec
53
+ monkey_patch_backtrace_formatter
54
+
53
55
  config = ::RSpec.configuration
54
56
 
55
57
  config.color = true
56
58
  config.pattern = "pattern which doesn't match any files"
57
- config.backtrace_inclusion_patterns = [Regexp.new(Dir.getwd), /bin\/pact/]
59
+ config.backtrace_inclusion_patterns = [Regexp.new(Dir.getwd), /pact.*main/]
58
60
 
59
61
  config.extend Pact::Provider::RSpec::ClassMethods
60
62
  config.include Pact::Provider::RSpec::InstanceMethods
@@ -98,6 +100,12 @@ module Pact
98
100
  ["--options", Pact.project_root.join("lib/pact/provider/rspec/custom_options_file").to_s]
99
101
  end
100
102
 
103
+ def monkey_patch_backtrace_formatter
104
+ Pact::RSpec.with_rspec_3 do
105
+ require 'pact/provider/rspec/backtrace_formatter'
106
+ end
107
+ end
108
+
101
109
  def class_exists? name
102
110
  Kernel.const_get name
103
111
  rescue NameError
@@ -0,0 +1,19 @@
1
+ module RSpec
2
+ module Core
3
+
4
+ class BacktraceFormatter
5
+
6
+ # RSpec 3 has a hardwired @system_exclusion_patterns which removes everything matching /bin\//
7
+ # This causes *all* the backtrace lines to be cleaned, as rake pact:verify now shells out
8
+ # to the executable `pact verify ...`
9
+ # which then causes *all* the lines to be included
10
+
11
+ def exclude?(line)
12
+ return false if @full_backtrace
13
+ matches_an_exclusion_pattern?(line) &&
14
+ @inclusion_patterns.none? { |p| p =~ line }
15
+ end
16
+
17
+ end
18
+ end
19
+ end
data/lib/pact/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Pact
2
- VERSION = "1.2.1.rc2"
2
+ VERSION = "1.3.0"
3
3
  end
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pact
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1.rc2
5
- prerelease: 6
4
+ version: 1.3.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - James Fraser
@@ -13,12 +12,11 @@ authors:
13
12
  autorequire:
14
13
  bindir: bin
15
14
  cert_chain: []
16
- date: 2014-06-13 00:00:00.000000000 Z
15
+ date: 2014-06-18 00:00:00.000000000 Z
17
16
  dependencies:
18
17
  - !ruby/object:Gem::Dependency
19
18
  name: randexp
20
19
  requirement: !ruby/object:Gem::Requirement
21
- none: false
22
20
  requirements:
23
21
  - - ~>
24
22
  - !ruby/object:Gem::Version
@@ -26,7 +24,6 @@ dependencies:
26
24
  type: :runtime
27
25
  prerelease: false
28
26
  version_requirements: !ruby/object:Gem::Requirement
29
- none: false
30
27
  requirements:
31
28
  - - ~>
32
29
  - !ruby/object:Gem::Version
@@ -34,23 +31,20 @@ dependencies:
34
31
  - !ruby/object:Gem::Dependency
35
32
  name: rspec
36
33
  requirement: !ruby/object:Gem::Requirement
37
- none: false
38
34
  requirements:
39
- - - ! '>='
35
+ - - '>='
40
36
  - !ruby/object:Gem::Version
41
37
  version: '2.14'
42
38
  type: :runtime
43
39
  prerelease: false
44
40
  version_requirements: !ruby/object:Gem::Requirement
45
- none: false
46
41
  requirements:
47
- - - ! '>='
42
+ - - '>='
48
43
  - !ruby/object:Gem::Version
49
44
  version: '2.14'
50
45
  - !ruby/object:Gem::Dependency
51
46
  name: find_a_port
52
47
  requirement: !ruby/object:Gem::Requirement
53
- none: false
54
48
  requirements:
55
49
  - - ~>
56
50
  - !ruby/object:Gem::Version
@@ -58,7 +52,6 @@ dependencies:
58
52
  type: :runtime
59
53
  prerelease: false
60
54
  version_requirements: !ruby/object:Gem::Requirement
61
- none: false
62
55
  requirements:
63
56
  - - ~>
64
57
  - !ruby/object:Gem::Version
@@ -66,7 +59,6 @@ dependencies:
66
59
  - !ruby/object:Gem::Dependency
67
60
  name: rack-test
68
61
  requirement: !ruby/object:Gem::Requirement
69
- none: false
70
62
  requirements:
71
63
  - - ~>
72
64
  - !ruby/object:Gem::Version
@@ -74,7 +66,6 @@ dependencies:
74
66
  type: :runtime
75
67
  prerelease: false
76
68
  version_requirements: !ruby/object:Gem::Requirement
77
- none: false
78
69
  requirements:
79
70
  - - ~>
80
71
  - !ruby/object:Gem::Version
@@ -82,7 +73,6 @@ dependencies:
82
73
  - !ruby/object:Gem::Dependency
83
74
  name: awesome_print
84
75
  requirement: !ruby/object:Gem::Requirement
85
- none: false
86
76
  requirements:
87
77
  - - ~>
88
78
  - !ruby/object:Gem::Version
@@ -90,7 +80,6 @@ dependencies:
90
80
  type: :runtime
91
81
  prerelease: false
92
82
  version_requirements: !ruby/object:Gem::Requirement
93
- none: false
94
83
  requirements:
95
84
  - - ~>
96
85
  - !ruby/object:Gem::Version
@@ -98,55 +87,48 @@ dependencies:
98
87
  - !ruby/object:Gem::Dependency
99
88
  name: thor
100
89
  requirement: !ruby/object:Gem::Requirement
101
- none: false
102
90
  requirements:
103
- - - ! '>='
91
+ - - '>='
104
92
  - !ruby/object:Gem::Version
105
93
  version: '0'
106
94
  type: :runtime
107
95
  prerelease: false
108
96
  version_requirements: !ruby/object:Gem::Requirement
109
- none: false
110
97
  requirements:
111
- - - ! '>='
98
+ - - '>='
112
99
  - !ruby/object:Gem::Version
113
100
  version: '0'
114
101
  - !ruby/object:Gem::Dependency
115
102
  name: json
116
103
  requirement: !ruby/object:Gem::Requirement
117
- none: false
118
104
  requirements:
119
- - - ! '>='
105
+ - - '>='
120
106
  - !ruby/object:Gem::Version
121
107
  version: '0'
122
108
  type: :runtime
123
109
  prerelease: false
124
110
  version_requirements: !ruby/object:Gem::Requirement
125
- none: false
126
111
  requirements:
127
- - - ! '>='
112
+ - - '>='
128
113
  - !ruby/object:Gem::Version
129
114
  version: '0'
130
115
  - !ruby/object:Gem::Dependency
131
116
  name: webrick
132
117
  requirement: !ruby/object:Gem::Requirement
133
- none: false
134
118
  requirements:
135
- - - ! '>='
119
+ - - '>='
136
120
  - !ruby/object:Gem::Version
137
121
  version: '0'
138
122
  type: :runtime
139
123
  prerelease: false
140
124
  version_requirements: !ruby/object:Gem::Requirement
141
- none: false
142
125
  requirements:
143
- - - ! '>='
126
+ - - '>='
144
127
  - !ruby/object:Gem::Version
145
128
  version: '0'
146
129
  - !ruby/object:Gem::Dependency
147
130
  name: term-ansicolor
148
131
  requirement: !ruby/object:Gem::Requirement
149
- none: false
150
132
  requirements:
151
133
  - - ~>
152
134
  - !ruby/object:Gem::Version
@@ -154,7 +136,6 @@ dependencies:
154
136
  type: :runtime
155
137
  prerelease: false
156
138
  version_requirements: !ruby/object:Gem::Requirement
157
- none: false
158
139
  requirements:
159
140
  - - ~>
160
141
  - !ruby/object:Gem::Version
@@ -162,7 +143,6 @@ dependencies:
162
143
  - !ruby/object:Gem::Dependency
163
144
  name: rake
164
145
  requirement: !ruby/object:Gem::Requirement
165
- none: false
166
146
  requirements:
167
147
  - - ~>
168
148
  - !ruby/object:Gem::Version
@@ -170,7 +150,6 @@ dependencies:
170
150
  type: :development
171
151
  prerelease: false
172
152
  version_requirements: !ruby/object:Gem::Requirement
173
- none: false
174
153
  requirements:
175
154
  - - ~>
176
155
  - !ruby/object:Gem::Version
@@ -178,7 +157,6 @@ dependencies:
178
157
  - !ruby/object:Gem::Dependency
179
158
  name: webmock
180
159
  requirement: !ruby/object:Gem::Requirement
181
- none: false
182
160
  requirements:
183
161
  - - ~>
184
162
  - !ruby/object:Gem::Version
@@ -186,7 +164,6 @@ dependencies:
186
164
  type: :development
187
165
  prerelease: false
188
166
  version_requirements: !ruby/object:Gem::Requirement
189
- none: false
190
167
  requirements:
191
168
  - - ~>
192
169
  - !ruby/object:Gem::Version
@@ -194,23 +171,20 @@ dependencies:
194
171
  - !ruby/object:Gem::Dependency
195
172
  name: pry
196
173
  requirement: !ruby/object:Gem::Requirement
197
- none: false
198
174
  requirements:
199
- - - ! '>='
175
+ - - '>='
200
176
  - !ruby/object:Gem::Version
201
177
  version: '0'
202
178
  type: :development
203
179
  prerelease: false
204
180
  version_requirements: !ruby/object:Gem::Requirement
205
- none: false
206
181
  requirements:
207
- - - ! '>='
182
+ - - '>='
208
183
  - !ruby/object:Gem::Version
209
184
  version: '0'
210
185
  - !ruby/object:Gem::Dependency
211
186
  name: fakefs
212
187
  requirement: !ruby/object:Gem::Requirement
213
- none: false
214
188
  requirements:
215
189
  - - ~>
216
190
  - !ruby/object:Gem::Version
@@ -218,7 +192,6 @@ dependencies:
218
192
  type: :development
219
193
  prerelease: false
220
194
  version_requirements: !ruby/object:Gem::Requirement
221
- none: false
222
195
  requirements:
223
196
  - - ~>
224
197
  - !ruby/object:Gem::Version
@@ -226,7 +199,6 @@ dependencies:
226
199
  - !ruby/object:Gem::Dependency
227
200
  name: hashie
228
201
  requirement: !ruby/object:Gem::Requirement
229
- none: false
230
202
  requirements:
231
203
  - - ~>
232
204
  - !ruby/object:Gem::Version
@@ -234,7 +206,6 @@ dependencies:
234
206
  type: :development
235
207
  prerelease: false
236
208
  version_requirements: !ruby/object:Gem::Requirement
237
- none: false
238
209
  requirements:
239
210
  - - ~>
240
211
  - !ruby/object:Gem::Version
@@ -242,33 +213,29 @@ dependencies:
242
213
  - !ruby/object:Gem::Dependency
243
214
  name: activesupport
244
215
  requirement: !ruby/object:Gem::Requirement
245
- none: false
246
216
  requirements:
247
- - - ! '>='
217
+ - - '>='
248
218
  - !ruby/object:Gem::Version
249
219
  version: '0'
250
220
  type: :development
251
221
  prerelease: false
252
222
  version_requirements: !ruby/object:Gem::Requirement
253
- none: false
254
223
  requirements:
255
- - - ! '>='
224
+ - - '>='
256
225
  - !ruby/object:Gem::Version
257
226
  version: '0'
258
227
  - !ruby/object:Gem::Dependency
259
228
  name: faraday
260
229
  requirement: !ruby/object:Gem::Requirement
261
- none: false
262
230
  requirements:
263
- - - ! '>='
231
+ - - '>='
264
232
  - !ruby/object:Gem::Version
265
233
  version: '0'
266
234
  type: :development
267
235
  prerelease: false
268
236
  version_requirements: !ruby/object:Gem::Requirement
269
- none: false
270
237
  requirements:
271
- - - ! '>='
238
+ - - '>='
272
239
  - !ruby/object:Gem::Version
273
240
  version: '0'
274
241
  description: Enables consumer driven contract testing, providing a mock service and
@@ -420,6 +387,7 @@ files:
420
387
  - lib/pact/provider/print_missing_provider_states.rb
421
388
  - lib/pact/provider/request.rb
422
389
  - lib/pact/provider/rspec.rb
390
+ - lib/pact/provider/rspec/backtrace_formatter.rb
423
391
  - lib/pact/provider/rspec/custom_options_file
424
392
  - lib/pact/provider/rspec/formatter_rspec_2.rb
425
393
  - lib/pact/provider/rspec/formatter_rspec_3.rb
@@ -547,30 +515,26 @@ files:
547
515
  homepage: https://github.com/realestate-com-au/pact
548
516
  licenses:
549
517
  - MIT
518
+ metadata: {}
550
519
  post_install_message:
551
520
  rdoc_options: []
552
521
  require_paths:
553
522
  - lib
554
523
  required_ruby_version: !ruby/object:Gem::Requirement
555
- none: false
556
524
  requirements:
557
- - - ! '>='
525
+ - - '>='
558
526
  - !ruby/object:Gem::Version
559
527
  version: '0'
560
- segments:
561
- - 0
562
- hash: -3125311526466390789
563
528
  required_rubygems_version: !ruby/object:Gem::Requirement
564
- none: false
565
529
  requirements:
566
- - - ! '>'
530
+ - - '>='
567
531
  - !ruby/object:Gem::Version
568
- version: 1.3.1
532
+ version: '0'
569
533
  requirements: []
570
534
  rubyforge_project:
571
- rubygems_version: 1.8.23
535
+ rubygems_version: 2.0.14
572
536
  signing_key:
573
- specification_version: 3
537
+ specification_version: 4
574
538
  summary: Enables consumer driven contract testing, providing a mock service and DSL
575
539
  for the consumer project, and interaction playback and verification for the service
576
540
  provider project.