rest_baby 0.2 → 0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ChangeLog +6 -1
- data/Gemfile +3 -1
- data/cucumber.yml +1 -1
- data/doc/MockRestService.html +5 -13
- data/doc/RestBaby/Client.html +13 -13
- data/doc/RestBaby.html +1 -1
- data/doc/_index.html +4 -45
- data/doc/class_list.html +1 -1
- data/doc/css/style.css +1 -1
- data/doc/feature_list.html +39 -39
- data/doc/file.README.html +5 -5
- data/doc/frames.html +5 -7
- data/doc/index.html +5 -5
- data/doc/js/app.js +7 -2
- data/doc/method_list.html +20 -26
- data/doc/requirements/features/headers/header_options.html +45 -33
- data/doc/requirements/features/headers.html +5 -4
- data/doc/requirements/features/print_response.html +26 -138
- data/doc/requirements/features/rest_client.html +23 -23
- data/doc/requirements/features.html +9 -8
- data/doc/requirements/step_transformers.html +206 -222
- data/doc/requirements/tags/authentication.html +3 -3
- data/doc/requirements/tags/core.html +3 -3
- data/doc/requirements/tags/delete.html +3 -3
- data/doc/requirements/tags/extended.html +3 -3
- data/doc/requirements/tags/get.html +3 -3
- data/doc/requirements/tags/headers.html +3 -3
- data/doc/requirements/tags/post.html +3 -3
- data/doc/requirements/tags/print.html +3 -3
- data/doc/requirements/tags/put.html +3 -3
- data/doc/requirements/tags/wip.html +187 -0
- data/doc/requirements/tags.html +40 -39
- data/doc/requirements.html +10 -9
- data/doc/step_list.html +166 -210
- data/doc/stepdefinition_list.html +36 -36
- data/doc/tag_list.html +12 -6
- data/doc/top-level-namespace.html +5 -14
- data/features/headers/header_options.feature +9 -9
- data/features/print_response.feature +0 -25
- data/features/step_definitions/header_steps.rb +8 -3
- data/features/step_definitions/rest_client_steps.rb +1 -6
- data/features/support/env.rb +0 -1
- data/features/support/mock_rest_service.rb +1 -5
- data/lib/rest_baby/version.rb +1 -1
- data/lib/rest_baby.rb +143 -88
- data/rest_baby.gemspec +2 -2
- metadata +28 -30
- data/doc/PinchRestService.html +0 -349
- data/features/support/pinch_rest_service.rb +0 -21
@@ -84,8 +84,8 @@
|
|
84
84
|
<li class="r2">
|
85
85
|
<span class='object_link'>
|
86
86
|
<span class="pre">Given</span>
|
87
|
-
<a href="requirements/step_transformers.html#step_definition2-stepdefinition" title="/^I have "(GET|PUT|POST|DELETE)" service for "(
|
88
|
-
<span class="name">/^I have "(GET|PUT|POST|DELETE)" service for "(
|
87
|
+
<a href="requirements/step_transformers.html#step_definition2-stepdefinition" title="/^I have "(GET|PUT|POST|DELETE)" service for "([^"]*) with the following headers$/">
|
88
|
+
<span class="name">/^I have "(GET|PUT|POST|DELETE)" service for "([^"]*) with the following headers$/</span>
|
89
89
|
</a>
|
90
90
|
</span>
|
91
91
|
<small>features/step_definitions/header_steps.rb:8</small>
|
@@ -94,9 +94,9 @@
|
|
94
94
|
|
95
95
|
<li class="r1">
|
96
96
|
<span class='object_link'>
|
97
|
-
<span class="pre">
|
98
|
-
<a href="requirements/step_transformers.html#step_definition3-stepdefinition" title="/^I have
|
99
|
-
<span class="name">/^I have
|
97
|
+
<span class="pre">Given</span>
|
98
|
+
<a href="requirements/step_transformers.html#step_definition3-stepdefinition" title="/^I have "(GET|PUT|POST|DELETE)" service for "([^"]*) for user "([^"]*) and password "([^"]*)$/">
|
99
|
+
<span class="name">/^I have "(GET|PUT|POST|DELETE)" service for "([^"]*) for user "([^"]*) and password "([^"]*)$/</span>
|
100
100
|
</a>
|
101
101
|
</span>
|
102
102
|
<small>features/step_definitions/header_steps.rb:13</small>
|
@@ -104,20 +104,31 @@
|
|
104
104
|
|
105
105
|
|
106
106
|
<li class="r2">
|
107
|
+
<span class='object_link'>
|
108
|
+
<span class="pre">When</span>
|
109
|
+
<a href="requirements/step_transformers.html#step_definition4-stepdefinition" title="/^I have the following headers?$/">
|
110
|
+
<span class="name">/^I have the following headers?$/</span>
|
111
|
+
</a>
|
112
|
+
</span>
|
113
|
+
<small>features/step_definitions/header_steps.rb:18</small>
|
114
|
+
</li>
|
115
|
+
|
116
|
+
|
117
|
+
<li class="r1">
|
107
118
|
<span class='object_link'>
|
108
119
|
<span class="pre">Given</span>
|
109
|
-
<a href="requirements/step_transformers.html#
|
120
|
+
<a href="requirements/step_transformers.html#step_definition5-stepdefinition" title="/^I have basic auth for user "(.*?)" and password "(.*?)"$/">
|
110
121
|
<span class="name">/^I have basic auth for user "(.*?)" and password "(.*?)"$/</span>
|
111
122
|
</a>
|
112
123
|
</span>
|
113
|
-
<small>features/step_definitions/header_steps.rb:
|
124
|
+
<small>features/step_definitions/header_steps.rb:22</small>
|
114
125
|
</li>
|
115
126
|
|
116
127
|
|
117
|
-
<li class="
|
128
|
+
<li class="r2">
|
118
129
|
<span class='object_link'>
|
119
130
|
<span class="pre">Given</span>
|
120
|
-
<a href="requirements/step_transformers.html#
|
131
|
+
<a href="requirements/step_transformers.html#step_definition6-stepdefinition" title="/^I have a web service$/">
|
121
132
|
<span class="name">/^I have a web service$/</span>
|
122
133
|
</a>
|
123
134
|
</span>
|
@@ -125,10 +136,10 @@
|
|
125
136
|
</li>
|
126
137
|
|
127
138
|
|
128
|
-
<li class="
|
139
|
+
<li class="r1">
|
129
140
|
<span class='object_link'>
|
130
141
|
<span class="pre">Given</span>
|
131
|
-
<a href="requirements/step_transformers.html#
|
142
|
+
<a href="requirements/step_transformers.html#step_definition7-stepdefinition" title="/^I have "(GET|PUT|POST|DELETE)" service for "(.*?)"$/">
|
132
143
|
<span class="name">/^I have "(GET|PUT|POST|DELETE)" service for "(.*?)"$/</span>
|
133
144
|
</a>
|
134
145
|
</span>
|
@@ -136,10 +147,10 @@
|
|
136
147
|
</li>
|
137
148
|
|
138
149
|
|
139
|
-
<li class="
|
150
|
+
<li class="r2">
|
140
151
|
<span class='object_link'>
|
141
152
|
<span class="pre">Given</span>
|
142
|
-
<a href="requirements/step_transformers.html#
|
153
|
+
<a href="requirements/step_transformers.html#step_definition8-stepdefinition" title="/^I have "(GET|PUT|POST|DELETE)" service for "(.*?)" as follows$/">
|
143
154
|
<span class="name">/^I have "(GET|PUT|POST|DELETE)" service for "(.*?)" as follows$/</span>
|
144
155
|
</a>
|
145
156
|
</span>
|
@@ -147,10 +158,10 @@
|
|
147
158
|
</li>
|
148
159
|
|
149
160
|
|
150
|
-
<li class="
|
161
|
+
<li class="r1">
|
151
162
|
<span class='object_link'>
|
152
163
|
<span class="pre">Given</span>
|
153
|
-
<a href="requirements/step_transformers.html#
|
164
|
+
<a href="requirements/step_transformers.html#step_definition9-stepdefinition" title="/^I am a rest client$/">
|
154
165
|
<span class="name">/^I am a rest client$/</span>
|
155
166
|
</a>
|
156
167
|
</span>
|
@@ -158,10 +169,10 @@
|
|
158
169
|
</li>
|
159
170
|
|
160
171
|
|
161
|
-
<li class="
|
172
|
+
<li class="r2">
|
162
173
|
<span class='object_link'>
|
163
174
|
<span class="pre">When</span>
|
164
|
-
<a href="requirements/step_transformers.html#
|
175
|
+
<a href="requirements/step_transformers.html#step_definition10-stepdefinition" title="/^I "(GET|DELETE)" from the web service$/">
|
165
176
|
<span class="name">/^I "(GET|DELETE)" from the web service$/</span>
|
166
177
|
</a>
|
167
178
|
</span>
|
@@ -169,10 +180,10 @@
|
|
169
180
|
</li>
|
170
181
|
|
171
182
|
|
172
|
-
<li class="
|
183
|
+
<li class="r1">
|
173
184
|
<span class='object_link'>
|
174
185
|
<span class="pre">When</span>
|
175
|
-
<a href="requirements/step_transformers.html#
|
186
|
+
<a href="requirements/step_transformers.html#step_definition11-stepdefinition" title="/^I "(PUT|POST)" to the web service with the following$/">
|
176
187
|
<span class="name">/^I "(PUT|POST)" to the web service with the following$/</span>
|
177
188
|
</a>
|
178
189
|
</span>
|
@@ -180,10 +191,10 @@
|
|
180
191
|
</li>
|
181
192
|
|
182
193
|
|
183
|
-
<li class="
|
194
|
+
<li class="r2">
|
184
195
|
<span class='object_link'>
|
185
196
|
<span class="pre">When</span>
|
186
|
-
<a href="requirements/step_transformers.html#
|
197
|
+
<a href="requirements/step_transformers.html#step_definition12-stepdefinition" title="/^I pause$/">
|
187
198
|
<span class="name">/^I pause$/</span>
|
188
199
|
</a>
|
189
200
|
</span>
|
@@ -191,10 +202,10 @@
|
|
191
202
|
</li>
|
192
203
|
|
193
204
|
|
194
|
-
<li class="
|
205
|
+
<li class="r1">
|
195
206
|
<span class='object_link'>
|
196
207
|
<span class="pre">Then</span>
|
197
|
-
<a href="requirements/step_transformers.html#
|
208
|
+
<a href="requirements/step_transformers.html#step_definition13-stepdefinition" title="/^I receive the expected message$/">
|
198
209
|
<span class="name">/^I receive the expected message$/</span>
|
199
210
|
</a>
|
200
211
|
</span>
|
@@ -202,10 +213,10 @@
|
|
202
213
|
</li>
|
203
214
|
|
204
215
|
|
205
|
-
<li class="
|
216
|
+
<li class="r2">
|
206
217
|
<span class='object_link'>
|
207
218
|
<span class="pre">Then</span>
|
208
|
-
<a href="requirements/step_transformers.html#
|
219
|
+
<a href="requirements/step_transformers.html#step_definition14-stepdefinition" title="/^I receive the following$/">
|
209
220
|
<span class="name">/^I receive the following$/</span>
|
210
221
|
</a>
|
211
222
|
</span>
|
@@ -213,17 +224,6 @@
|
|
213
224
|
</li>
|
214
225
|
|
215
226
|
|
216
|
-
<li class="r2">
|
217
|
-
<span class='object_link'>
|
218
|
-
<span class="pre">Then</span>
|
219
|
-
<a href="requirements/step_transformers.html#step_definition14-stepdefinition" title="/^the response prints like the following$/">
|
220
|
-
<span class="name">/^the response prints like the following$/</span>
|
221
|
-
</a>
|
222
|
-
</span>
|
223
|
-
<small>features/step_definitions/rest_client_steps.rb:56</small>
|
224
|
-
</li>
|
225
|
-
|
226
|
-
|
227
227
|
</ul>
|
228
228
|
</div>
|
229
229
|
</body>
|
data/doc/tag_list.html
CHANGED
@@ -84,42 +84,48 @@
|
|
84
84
|
|
85
85
|
|
86
86
|
<li class="r1">
|
87
|
-
<span class='object_link'><a href="requirements/tags/
|
87
|
+
<span class='object_link'><a href="requirements/tags/core.html" title="requirements::tags::core (tag)">@core</a></span>
|
88
88
|
<small>4</small>
|
89
89
|
</li>
|
90
90
|
|
91
91
|
|
92
92
|
<li class="r2">
|
93
|
-
<span class='object_link'><a href="requirements/tags/
|
93
|
+
<span class='object_link'><a href="requirements/tags/print.html" title="requirements::tags::print (tag)">@print</a></span>
|
94
94
|
<small>4</small>
|
95
95
|
</li>
|
96
96
|
|
97
97
|
|
98
98
|
<li class="r1">
|
99
|
+
<span class='object_link'><a href="requirements/tags/wip.html" title="requirements::tags::wip (tag)">@wip</a></span>
|
100
|
+
<small>4</small>
|
101
|
+
</li>
|
102
|
+
|
103
|
+
|
104
|
+
<li class="r2">
|
99
105
|
<span class='object_link'><a href="requirements/tags/get.html" title="requirements::tags::get (tag)">@get</a></span>
|
100
106
|
<small>3</small>
|
101
107
|
</li>
|
102
108
|
|
103
109
|
|
104
|
-
<li class="
|
110
|
+
<li class="r1">
|
105
111
|
<span class='object_link'><a href="requirements/tags/put.html" title="requirements::tags::put (tag)">@put</a></span>
|
106
112
|
<small>2</small>
|
107
113
|
</li>
|
108
114
|
|
109
115
|
|
110
|
-
<li class="
|
116
|
+
<li class="r2">
|
111
117
|
<span class='object_link'><a href="requirements/tags/headers.html" title="requirements::tags::headers (tag)">@headers</a></span>
|
112
118
|
<small>2</small>
|
113
119
|
</li>
|
114
120
|
|
115
121
|
|
116
|
-
<li class="
|
122
|
+
<li class="r1">
|
117
123
|
<span class='object_link'><a href="requirements/tags/delete.html" title="requirements::tags::delete (tag)">@delete</a></span>
|
118
124
|
<small>2</small>
|
119
125
|
</li>
|
120
126
|
|
121
127
|
|
122
|
-
<li class="
|
128
|
+
<li class="r2">
|
123
129
|
<span class='object_link'><a href="requirements/tags/authentication.html" title="requirements::tags::authentication (tag)">@authentication</a></span>
|
124
130
|
<small>2</small>
|
125
131
|
</li>
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Top Level Namespace
|
8
8
|
|
9
|
-
— Documentation by YARD 0.8.7
|
9
|
+
— Documentation by YARD 0.8.7.3
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -105,7 +105,7 @@
|
|
105
105
|
|
106
106
|
|
107
107
|
<dt class="r1">Includes:</dt>
|
108
|
-
<dd class="r1">
|
108
|
+
<dd class="r1">WebMock::API</dd>
|
109
109
|
|
110
110
|
|
111
111
|
|
@@ -118,11 +118,9 @@
|
|
118
118
|
<p class="children">
|
119
119
|
|
120
120
|
|
121
|
-
<strong class="modules">Modules:</strong> <span class='object_link'><a href="RestBaby.html" title="RestBaby (module)">RestBaby</a></span>
|
122
|
-
|
123
121
|
|
124
122
|
|
125
|
-
<strong class="classes">Classes:</strong> <span class='object_link'><a href="MockRestService.html" title="MockRestService (class)">MockRestService</a></span
|
123
|
+
<strong class="classes">Classes:</strong> <span class='object_link'><a href="MockRestService.html" title="MockRestService (class)">MockRestService</a></span>
|
126
124
|
|
127
125
|
|
128
126
|
</p>
|
@@ -141,12 +139,6 @@
|
|
141
139
|
|
142
140
|
|
143
141
|
|
144
|
-
|
145
|
-
|
146
|
-
<h3 class="inherited">Constants included
|
147
|
-
from <span class='object_link'><a href="RestBaby.html" title="RestBaby (module)">RestBaby</a></span></h3>
|
148
|
-
<p class="inherited"><span class='object_link'><a href="RestBaby.html#VERSION-constant" title="RestBaby::VERSION (constant)">RestBaby::VERSION</a></span></p>
|
149
|
-
|
150
142
|
|
151
143
|
|
152
144
|
|
@@ -192,7 +184,6 @@
|
|
192
184
|
|
193
185
|
|
194
186
|
|
195
|
-
|
196
187
|
|
197
188
|
<div id="instance_method_details" class="method_details_list">
|
198
189
|
<h2>Instance Method Details</h2>
|
@@ -235,9 +226,9 @@
|
|
235
226
|
</div>
|
236
227
|
|
237
228
|
<div id="footer">
|
238
|
-
Generated on
|
229
|
+
Generated on Thu Feb 13 23:38:39 2014 by
|
239
230
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
240
|
-
0.8.7 (ruby-2.0.0).
|
231
|
+
0.8.7.3 (ruby-2.0.0).
|
241
232
|
</div>
|
242
233
|
|
243
234
|
</body>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Feature: Create a basic rest client that can get, put, post, and delete
|
2
2
|
|
3
|
-
@extended @get @headers
|
3
|
+
@extended @get @headers @wip
|
4
4
|
Scenario: client uses an Accept header for a GET
|
5
5
|
Given I have a web service
|
6
6
|
And I have "GET" service for "/test" with the following headers
|
@@ -11,7 +11,7 @@ Scenario: client uses an Accept header for a GET
|
|
11
11
|
And I "GET" from the web service
|
12
12
|
Then I receive the expected message
|
13
13
|
|
14
|
-
@extended @post @headers
|
14
|
+
@extended @post @headers @wip
|
15
15
|
Scenario: client uses an Accept and a Content-Type header for a POST
|
16
16
|
Given I have a web service
|
17
17
|
And I have "POST" service for "/test" with the following headers
|
@@ -22,24 +22,24 @@ Scenario: client uses an Accept and a Content-Type header for a POST
|
|
22
22
|
| Content-Type | application/json |
|
23
23
|
| Accept | application/json |
|
24
24
|
And I "POST" to the web service with the following
|
25
|
-
|
26
|
-
{
|
27
|
-
|
25
|
+
"""
|
26
|
+
{"Question": "What is the meaning of life?"}
|
27
|
+
"""
|
28
28
|
Then I receive the expected message
|
29
29
|
|
30
|
-
@extended @post @authentication
|
30
|
+
@extended @post @authentication @wip
|
31
31
|
Scenario: client uses basic authentication
|
32
32
|
Given I have a web service
|
33
|
-
And I have "GET" service for "/test"
|
33
|
+
And I have "GET" service for "/test" for user "test" and password "rest"
|
34
34
|
And I am a rest client
|
35
35
|
And I have basic auth for user "test" and password "rest"
|
36
36
|
And I "GET" from the web service
|
37
37
|
Then I receive the expected message
|
38
38
|
|
39
|
-
@extended @post @authentication
|
39
|
+
@extended @post @authentication @wip
|
40
40
|
Scenario: client uses a secure web server
|
41
41
|
Given I have a secure web service
|
42
|
-
And I have "GET" service for "/test"
|
42
|
+
And I have "GET" service for "/test" for user "test" and password "rest"
|
43
43
|
And I am a rest client
|
44
44
|
And I have basic auth for user "test" and password "rest"
|
45
45
|
And I "GET" from the web service
|
@@ -11,13 +11,6 @@ Scenario: client rest Get
|
|
11
11
|
# And I pause
|
12
12
|
When I "GET" from the web service
|
13
13
|
Then I receive the expected message
|
14
|
-
And the response prints like the following
|
15
|
-
"""
|
16
|
-
CODE = 200
|
17
|
-
MESSAGE =
|
18
|
-
BODY = {'Answer': 'What did you expect?'}
|
19
|
-
"""
|
20
|
-
|
21
14
|
|
22
15
|
@put @extended @print
|
23
16
|
Scenario: client rest Put
|
@@ -32,12 +25,6 @@ Scenario: client rest Put
|
|
32
25
|
{'Answer': 'What did you expect?'}
|
33
26
|
"""
|
34
27
|
Then I receive the expected message
|
35
|
-
And the response prints like the following
|
36
|
-
"""
|
37
|
-
CODE = 200
|
38
|
-
MESSAGE =
|
39
|
-
BODY = {'Answer': 'What did you expect?'}
|
40
|
-
"""
|
41
28
|
|
42
29
|
@post @extended @print
|
43
30
|
Scenario: client rest Post
|
@@ -52,12 +39,6 @@ Scenario: client rest Post
|
|
52
39
|
{'Answer': 'What did you expect?'}
|
53
40
|
"""
|
54
41
|
Then I receive the expected message
|
55
|
-
And the response prints like the following
|
56
|
-
"""
|
57
|
-
CODE = 200
|
58
|
-
MESSAGE =
|
59
|
-
BODY = {'Answer': 'What did you expect?'}
|
60
|
-
"""
|
61
42
|
|
62
43
|
@delete @extended @print
|
63
44
|
Scenario: client rest Delete
|
@@ -69,9 +50,3 @@ Scenario: client rest Delete
|
|
69
50
|
And I am a rest client
|
70
51
|
When I "DELETE" from the web service
|
71
52
|
Then I receive the expected message
|
72
|
-
And the response prints like the following
|
73
|
-
"""
|
74
|
-
CODE = 200
|
75
|
-
MESSAGE =
|
76
|
-
BODY = {'Answer': 'What did you expect?'}
|
77
|
-
"""
|
@@ -2,18 +2,23 @@ Given(/^I have a secure web service$/) do
|
|
2
2
|
@protocol = 'https'
|
3
3
|
@server = FigNewton.server
|
4
4
|
@port = FigNewton.port
|
5
|
-
|
5
|
+
@mockservice = MockRestService.new(@server, @port, @protocol)
|
6
6
|
end
|
7
7
|
|
8
|
-
Given(/^I have "(GET|PUT|POST|DELETE)" service for "(
|
8
|
+
Given(/^I have "(GET|PUT|POST|DELETE)" service for "([^"]*) with the following headers$/) do |type, path, table|
|
9
9
|
@path = path
|
10
10
|
@mockservice.store_msg(type, path, DEFAULT_MESSAGE, table.rows_hash)
|
11
11
|
end
|
12
12
|
|
13
|
+
Given(/^I have "(GET|PUT|POST|DELETE)" service for "([^"]*) for user "([^"]*) and password "([^"]*)$/) do |type, path, user, password, table|
|
14
|
+
@path = path
|
15
|
+
@mockservice.store_msg(type, path, DEFAULT_MESSAGE, table.rows_hash, user, password)
|
16
|
+
end
|
17
|
+
|
13
18
|
When(/^I have the following headers?$/) do |table|
|
14
19
|
@restbaby.set_headers(table.rows_hash)
|
15
20
|
end
|
16
21
|
|
17
22
|
Given(/^I have basic auth for user "(.*?)" and password "(.*?)"$/) do |user, password|
|
18
|
-
|
23
|
+
@restbaby.set_auth(user, password)
|
19
24
|
end
|
@@ -4,7 +4,7 @@ Given(/^I have a web service$/) do
|
|
4
4
|
@protocol = 'http'
|
5
5
|
@server = FigNewton.server
|
6
6
|
@port = FigNewton.port
|
7
|
-
|
7
|
+
@mockservice = MockRestService.new(@server, @port, @protocol)
|
8
8
|
end
|
9
9
|
|
10
10
|
Given(/^I have "(GET|PUT|POST|DELETE)" service for "(.*?)"$/) do |type, path|
|
@@ -26,7 +26,6 @@ When(/^I "(GET|DELETE)" from the web service$/) do |type|
|
|
26
26
|
when 'get'
|
27
27
|
@response = @restbaby.get
|
28
28
|
when 'delete'
|
29
|
-
# @response = @restbaby.delete(@path)
|
30
29
|
@response = @restbaby.delete
|
31
30
|
end
|
32
31
|
end
|
@@ -53,7 +52,3 @@ Then(/^I receive the following$/) do |message|
|
|
53
52
|
expect(@response.code).to eq('200')
|
54
53
|
expect(@response.body).to eq(message)
|
55
54
|
end
|
56
|
-
|
57
|
-
Then(/^the response prints like the following$/) do |response|
|
58
|
-
expect(@restbaby.print_last_response).to eq(response)
|
59
|
-
end
|
data/features/support/env.rb
CHANGED
@@ -20,13 +20,9 @@ class MockRestService
|
|
20
20
|
auth_string = "#{user}:#{password}@" unless (user.nil? || password.nil?)
|
21
21
|
case type.downcase
|
22
22
|
when "get", "delete"
|
23
|
-
|
24
|
-
# with(:headers => new_headers).
|
25
|
-
# to_return({:body => "#{message}", :status => 200}, :headers => {})
|
26
|
-
stub_request(type.downcase.to_sym, "#{@protocol}://#{auth_string}#{@host}:#{@port}#{path}").
|
23
|
+
WebMock.stub_request(type.downcase.to_sym, "#{@protocol}://#{auth_string}#{@host}:#{@port}#{path}").
|
27
24
|
with(:headers => new_headers).
|
28
25
|
to_return({:body => "#{message}", :status => 200}, :headers => {})
|
29
|
-
|
30
26
|
when "post", "put"
|
31
27
|
WebMock.stub_request(type.downcase.to_sym, "#{@protocol}://#{auth_string}#{@host}:#{@port}#{path}").
|
32
28
|
with(:headers => new_headers).
|
data/lib/rest_baby/version.rb
CHANGED