pact-mock_service 0.5.5 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/pact/consumer/server.rb +2 -0
- data/lib/pact/mock_service/cli.rb +3 -0
- data/lib/pact/mock_service/run.rb +7 -2
- data/lib/pact/mock_service/version.rb +1 -1
- metadata +44 -44
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0c9a6ec6cd806399f24c1e6e37d85305b6200fe2
|
4
|
+
data.tar.gz: 284cb2aba7762fba9da3f5a95bf42afdef0b3856
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33c3b638b6da0804dba6f837253a0ab1f2e2065e4b36f81a7d0002c4a92c251d79aab7cf8567f17537cde892cc803c2928d61a394e1a12dac66f6f053a96a3c0
|
7
|
+
data.tar.gz: 657dde29df0034f38d757dd6736d214610715956192053afba34fa3c7bc167e6cdc4870f978636ae6b4819c3cbe980ac287aa86ed95b86063e52cc9fbf04f523
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,10 @@ Do this to generate your change history
|
|
2
2
|
|
3
3
|
git log --pretty=format:' * %h - %s (%an, %ad)' vX.Y.Z..HEAD
|
4
4
|
|
5
|
+
### 0.6.0 (6 July 2015)
|
6
|
+
|
7
|
+
* fadbbd5 - Added a CLI option to alter binding address (Andrew Browne, Mon Jul 6 10:36:21 2015 +1000)
|
8
|
+
|
5
9
|
### 0.5.5 (25 May 2015)
|
6
10
|
|
7
11
|
* 3b2ec14 - Produce a valid rack response on interaction post error (David Heath, Fri May 22 16:42:03 2015 +0100)
|
data/lib/pact/consumer/server.rb
CHANGED
@@ -12,6 +12,7 @@ module Pact
|
|
12
12
|
|
13
13
|
desc 'service', "Start a mock service. If the consumer, provider and pact-dir options are provided, the pact will be written automatically on shutdown."
|
14
14
|
method_option :port, aliases: "-p", desc: "Port on which to run the service"
|
15
|
+
method_option :host, aliases: "-h", desc: "Host on which to bind the service", default: 'localhost'
|
15
16
|
method_option :log, aliases: "-l", desc: "File to which to log output"
|
16
17
|
method_option :ssl, desc: "Use a self-signed SSL cert to run the service over HTTPS"
|
17
18
|
method_option :cors, aliases: "-o", desc: "Support browser security in tests by responding to OPTIONS requests and adding CORS headers to mocked responses"
|
@@ -40,6 +41,7 @@ module Pact
|
|
40
41
|
|
41
42
|
desc 'start', "Start a mock service. If the consumer, provider and pact-dir options are provided, the pact will be written automatically on shutdown."
|
42
43
|
method_option :port, aliases: "-p", default: '1234', desc: "Port on which to run the service"
|
44
|
+
method_option :host, aliases: "-h", desc: "Host on which to bind the service", default: 'localhost'
|
43
45
|
method_option :log, aliases: "-l", desc: "File to which to log output"
|
44
46
|
method_option :ssl, desc: "Use a self-signed SSL cert to run the service over HTTPS"
|
45
47
|
method_option :cors, aliases: "-o", desc: "Support browser security in tests by responding to OPTIONS requests and adding CORS headers to mocked responses"
|
@@ -65,6 +67,7 @@ module Pact
|
|
65
67
|
|
66
68
|
desc 'restart', "Start or restart a mock service. If the consumer, provider and pact-dir options are provided, the pact will be written automatically on shutdown."
|
67
69
|
method_option :port, aliases: "-p", default: '1234', desc: "Port on which to run the service"
|
70
|
+
method_option :host, aliases: "-h", desc: "Host on which to bind the service", default: 'localhost'
|
68
71
|
method_option :log, aliases: "-l", desc: "File to which to log output"
|
69
72
|
method_option :ssl, desc: "Use a self-signed SSL cert to run the service over HTTPS"
|
70
73
|
method_option :cors, aliases: "-o", desc: "Support browser security in tests by responding to OPTIONS requests and adding CORS headers to mocked responses"
|
@@ -67,6 +67,7 @@ module Pact
|
|
67
67
|
def webbrick_opts
|
68
68
|
opts = {
|
69
69
|
:Port => port,
|
70
|
+
:Host => host,
|
70
71
|
:AccessLog => []
|
71
72
|
}
|
72
73
|
opts.merge!(ssl_opts) if options[:ssl]
|
@@ -85,9 +86,13 @@ module Pact
|
|
85
86
|
@port ||= options[:port] || FindAPort.available_port
|
86
87
|
end
|
87
88
|
|
89
|
+
def host
|
90
|
+
@host ||= options[:host] || "localhost"
|
91
|
+
end
|
92
|
+
|
88
93
|
def base_url
|
89
|
-
options[:ssl] ? "https
|
94
|
+
options[:ssl] ? "https://#{host}:#{port}" : "http://#{host}:#{port}"
|
90
95
|
end
|
91
96
|
end
|
92
97
|
end
|
93
|
-
end
|
98
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pact-mock_service
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Fraser
|
@@ -12,230 +12,230 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2015-
|
15
|
+
date: 2015-07-06 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: rack
|
19
19
|
requirement: !ruby/object:Gem::Requirement
|
20
20
|
requirements:
|
21
|
-
- -
|
21
|
+
- - ">="
|
22
22
|
- !ruby/object:Gem::Version
|
23
23
|
version: '0'
|
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'
|
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: find_a_port
|
47
47
|
requirement: !ruby/object:Gem::Requirement
|
48
48
|
requirements:
|
49
|
-
- - ~>
|
49
|
+
- - "~>"
|
50
50
|
- !ruby/object:Gem::Version
|
51
51
|
version: 1.0.1
|
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: 1.0.1
|
59
59
|
- !ruby/object:Gem::Dependency
|
60
60
|
name: rack-test
|
61
61
|
requirement: !ruby/object:Gem::Requirement
|
62
62
|
requirements:
|
63
|
-
- - ~>
|
63
|
+
- - "~>"
|
64
64
|
- !ruby/object:Gem::Version
|
65
65
|
version: 0.6.2
|
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: 0.6.2
|
73
73
|
- !ruby/object:Gem::Dependency
|
74
74
|
name: thor
|
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: json
|
89
89
|
requirement: !ruby/object:Gem::Requirement
|
90
90
|
requirements:
|
91
|
-
- -
|
91
|
+
- - ">="
|
92
92
|
- !ruby/object:Gem::Version
|
93
93
|
version: '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: '0'
|
101
101
|
- !ruby/object:Gem::Dependency
|
102
102
|
name: webrick
|
103
103
|
requirement: !ruby/object:Gem::Requirement
|
104
104
|
requirements:
|
105
|
-
- -
|
105
|
+
- - ">="
|
106
106
|
- !ruby/object:Gem::Version
|
107
107
|
version: '0'
|
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: '0'
|
115
115
|
- !ruby/object:Gem::Dependency
|
116
116
|
name: term-ansicolor
|
117
117
|
requirement: !ruby/object:Gem::Requirement
|
118
118
|
requirements:
|
119
|
-
- - ~>
|
119
|
+
- - "~>"
|
120
120
|
- !ruby/object:Gem::Version
|
121
121
|
version: '1.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: '1.0'
|
129
129
|
- !ruby/object:Gem::Dependency
|
130
130
|
name: pact-support
|
131
131
|
requirement: !ruby/object:Gem::Requirement
|
132
132
|
requirements:
|
133
|
-
- - ~>
|
133
|
+
- - "~>"
|
134
134
|
- !ruby/object:Gem::Version
|
135
135
|
version: 0.4.0
|
136
136
|
type: :runtime
|
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: 0.4.0
|
143
143
|
- !ruby/object:Gem::Dependency
|
144
144
|
name: rake
|
145
145
|
requirement: !ruby/object:Gem::Requirement
|
146
146
|
requirements:
|
147
|
-
- - ~>
|
147
|
+
- - "~>"
|
148
148
|
- !ruby/object:Gem::Version
|
149
149
|
version: 10.0.3
|
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: 10.0.3
|
157
157
|
- !ruby/object:Gem::Dependency
|
158
158
|
name: webmock
|
159
159
|
requirement: !ruby/object:Gem::Requirement
|
160
160
|
requirements:
|
161
|
-
- - ~>
|
161
|
+
- - "~>"
|
162
162
|
- !ruby/object:Gem::Version
|
163
163
|
version: 1.18.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: 1.18.0
|
171
171
|
- !ruby/object:Gem::Dependency
|
172
172
|
name: pry
|
173
173
|
requirement: !ruby/object:Gem::Requirement
|
174
174
|
requirements:
|
175
|
-
- -
|
175
|
+
- - ">="
|
176
176
|
- !ruby/object:Gem::Version
|
177
177
|
version: '0'
|
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'
|
185
185
|
- !ruby/object:Gem::Dependency
|
186
186
|
name: fakefs
|
187
187
|
requirement: !ruby/object:Gem::Requirement
|
188
188
|
requirements:
|
189
|
-
- - ~>
|
189
|
+
- - "~>"
|
190
190
|
- !ruby/object:Gem::Version
|
191
191
|
version: '0.4'
|
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: '0.4'
|
199
199
|
- !ruby/object:Gem::Dependency
|
200
200
|
name: hashie
|
201
201
|
requirement: !ruby/object:Gem::Requirement
|
202
202
|
requirements:
|
203
|
-
- - ~>
|
203
|
+
- - "~>"
|
204
204
|
- !ruby/object:Gem::Version
|
205
205
|
version: '2.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: '2.0'
|
213
213
|
- !ruby/object:Gem::Dependency
|
214
214
|
name: activesupport
|
215
215
|
requirement: !ruby/object:Gem::Requirement
|
216
216
|
requirements:
|
217
|
-
- -
|
217
|
+
- - ">="
|
218
218
|
- !ruby/object:Gem::Version
|
219
219
|
version: '0'
|
220
220
|
type: :development
|
221
221
|
prerelease: false
|
222
222
|
version_requirements: !ruby/object:Gem::Requirement
|
223
223
|
requirements:
|
224
|
-
- -
|
224
|
+
- - ">="
|
225
225
|
- !ruby/object:Gem::Version
|
226
226
|
version: '0'
|
227
227
|
- !ruby/object:Gem::Dependency
|
228
228
|
name: faraday
|
229
229
|
requirement: !ruby/object:Gem::Requirement
|
230
230
|
requirements:
|
231
|
-
- -
|
231
|
+
- - ">="
|
232
232
|
- !ruby/object:Gem::Version
|
233
233
|
version: '0'
|
234
234
|
type: :development
|
235
235
|
prerelease: false
|
236
236
|
version_requirements: !ruby/object:Gem::Requirement
|
237
237
|
requirements:
|
238
|
-
- -
|
238
|
+
- - ">="
|
239
239
|
- !ruby/object:Gem::Version
|
240
240
|
version: '0'
|
241
241
|
description:
|
@@ -250,6 +250,10 @@ executables:
|
|
250
250
|
extensions: []
|
251
251
|
extra_rdoc_files: []
|
252
252
|
files:
|
253
|
+
- CHANGELOG.md
|
254
|
+
- Gemfile
|
255
|
+
- LICENSE.txt
|
256
|
+
- README.md
|
253
257
|
- bin/pact-mock-service
|
254
258
|
- lib/pact/consumer/mock_service/cors_origin_header_middleware.rb
|
255
259
|
- lib/pact/consumer/mock_service/error_handler.rb
|
@@ -261,10 +265,11 @@ files:
|
|
261
265
|
- lib/pact/consumer_contract/interaction_decorator.rb
|
262
266
|
- lib/pact/consumer_contract/request_decorator.rb
|
263
267
|
- lib/pact/consumer_contract/response_decorator.rb
|
268
|
+
- lib/pact/mock_service.rb
|
264
269
|
- lib/pact/mock_service/app.rb
|
265
270
|
- lib/pact/mock_service/app_manager.rb
|
266
|
-
- lib/pact/mock_service/cli/pidfile.rb
|
267
271
|
- lib/pact/mock_service/cli.rb
|
272
|
+
- lib/pact/mock_service/cli/pidfile.rb
|
268
273
|
- lib/pact/mock_service/client.rb
|
269
274
|
- lib/pact/mock_service/control_server/app.rb
|
270
275
|
- lib/pact/mock_service/control_server/delegator.rb
|
@@ -284,6 +289,7 @@ files:
|
|
284
289
|
- lib/pact/mock_service/interactions/verified_interactions.rb
|
285
290
|
- lib/pact/mock_service/logger.rb
|
286
291
|
- lib/pact/mock_service/request_decorator.rb
|
292
|
+
- lib/pact/mock_service/request_handlers.rb
|
287
293
|
- lib/pact/mock_service/request_handlers/base_administration_request_handler.rb
|
288
294
|
- lib/pact/mock_service/request_handlers/base_request_handler.rb
|
289
295
|
- lib/pact/mock_service/request_handlers/index_get.rb
|
@@ -296,7 +302,6 @@ files:
|
|
296
302
|
- lib/pact/mock_service/request_handlers/options.rb
|
297
303
|
- lib/pact/mock_service/request_handlers/pact_post.rb
|
298
304
|
- lib/pact/mock_service/request_handlers/verification_get.rb
|
299
|
-
- lib/pact/mock_service/request_handlers.rb
|
300
305
|
- lib/pact/mock_service/response_decorator.rb
|
301
306
|
- lib/pact/mock_service/run.rb
|
302
307
|
- lib/pact/mock_service/server/respawn.rb
|
@@ -305,11 +310,6 @@ files:
|
|
305
310
|
- lib/pact/mock_service/session.rb
|
306
311
|
- lib/pact/mock_service/spawn.rb
|
307
312
|
- lib/pact/mock_service/version.rb
|
308
|
-
- lib/pact/mock_service.rb
|
309
|
-
- Gemfile
|
310
|
-
- LICENSE.txt
|
311
|
-
- README.md
|
312
|
-
- CHANGELOG.md
|
313
313
|
homepage: https://github.com/bethesque/pact-mock_service
|
314
314
|
licenses:
|
315
315
|
- MIT
|
@@ -320,17 +320,17 @@ require_paths:
|
|
320
320
|
- lib
|
321
321
|
required_ruby_version: !ruby/object:Gem::Requirement
|
322
322
|
requirements:
|
323
|
-
- -
|
323
|
+
- - ">="
|
324
324
|
- !ruby/object:Gem::Version
|
325
325
|
version: '0'
|
326
326
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
327
327
|
requirements:
|
328
|
-
- -
|
328
|
+
- - ">="
|
329
329
|
- !ruby/object:Gem::Version
|
330
330
|
version: '0'
|
331
331
|
requirements: []
|
332
332
|
rubyforge_project:
|
333
|
-
rubygems_version: 2.
|
333
|
+
rubygems_version: 2.4.8
|
334
334
|
signing_key:
|
335
335
|
specification_version: 4
|
336
336
|
summary: Provides a mock service for use with Pact
|