rest-assured 3.0.1 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c8bebfd6fd3857fc85f3d713ada8adb4fd595558
4
- data.tar.gz: e0451bae7509abb772bf2e80d13be71af79c6241
3
+ metadata.gz: 3a5e8abf7f99c8f523c3ba6211ae8349f18b1f1e
4
+ data.tar.gz: 43fa4ba68d8789d037f5b38d494f7e7d51f7270c
5
5
  SHA512:
6
- metadata.gz: 8ef30bd005cade9bfc00ec2557d8b79de98306d300d6e00b8ea2db929b532cfd056f4b1fbfe72aebb2b61ac2ce9d75f50776b9867741e9b5b01ed4fccb6a496f
7
- data.tar.gz: 56d74fd446acf8f62fec9883b6f3188570db77871e704fabdfdaf7e2c82bb173f1607e657421a4cb631120d08ea6cb381df66a295b267837d31c1b5cbbb92bbe
6
+ metadata.gz: d515e55391433fcfea6d76f57e4723240c72ab5eb113472b7f8275310fb6e7f7a1ff1bc20588c54a4d26990d36469eef9ba149871332ebea93615fbe9163f60b
7
+ data.tar.gz: 04027d5f288f7320b71f3b5c044ba8ee420344db5275f83b12b473e1241e6b94436cbe9a30629b39a52942b0ff777c056997c0da3f65b9981e6ee0185adca02e
data/LICENSE CHANGED
@@ -1,7 +1,21 @@
1
- Copyright 2010 British Broadcasting Corporation
1
+ MIT License
2
2
 
3
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
3
+ Copyright (c) 2018 artem avetisyan
4
4
 
5
- http://www.apache.org/licenses/LICENSE-2.0
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
6
11
 
7
- Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -101,7 +101,7 @@ module RestAssured
101
101
  end
102
102
 
103
103
  def self.migrate_db
104
- migrate = lambda { ActiveRecord::Migrator.migrate(File.expand_path('../../../db/migrate', __FILE__)) }
104
+ migrate = lambda { ActiveRecord::MigrationContext.new(File.expand_path('../../../db/migrate', __FILE__)).migrate }
105
105
  silence_stdout = lambda do |&thing|
106
106
  original_stdout = $stdout
107
107
  $stdout = File.open(File::NULL, "w")
@@ -1,3 +1,3 @@
1
1
  module RestAssured
2
- VERSION = '3.0.1'
2
+ VERSION = '4.0.0'
3
3
  end
@@ -8,19 +8,30 @@ module RestAssured::Utils
8
8
  expect { Net::HTTP.get('127.0.0.1', '/', free_port) }.to raise_error(Errno::ECONNREFUSED)
9
9
  end
10
10
 
11
- it 'knows if port is in use' do
12
- port = PortExplorer.free_port
11
+ context 'port is taken' do
12
+ let(:port) { PortExplorer.free_port }
13
+ server = nil
13
14
 
14
- Thread.new do
15
- TCPServer.open('127.0.0.1', port) do |serv|
16
- s = serv.accept
17
- s.puts 'Hello from test'
18
- s.close
19
- end
15
+ before :each do
16
+ server = TCPServer.new port
17
+ end
18
+
19
+ after :each do
20
+ server.close
20
21
  end
21
- sleep 0.5
22
22
 
23
- expect(PortExplorer.port_free?(port)).to eq(false)
23
+ it 'knows if port is in use' do
24
+ Thread.new do
25
+ loop do
26
+ Thread.start(server.accept) do |client|
27
+ client.puts "Hello!"
28
+ client.close
29
+ end
30
+ end
31
+ end
32
+
33
+ expect(PortExplorer.port_free?(port)).to eq(false)
34
+ end
24
35
  end
25
36
 
26
37
  it 'knows that port is free' do
metadata CHANGED
@@ -1,135 +1,135 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rest-assured
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Artem Avetisyan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-28 00:00:00.000000000 Z
11
+ date: 2018-05-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sinatra
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 1.4.0
20
- - - ~>
20
+ - - "~>"
21
21
  - !ruby/object:Gem::Version
22
22
  version: '2.0'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
- - - '>='
27
+ - - ">="
28
28
  - !ruby/object:Gem::Version
29
29
  version: 1.4.0
30
- - - ~>
30
+ - - "~>"
31
31
  - !ruby/object:Gem::Version
32
32
  version: '2.0'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: childprocess
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
- - - ~>
37
+ - - "~>"
38
38
  - !ruby/object:Gem::Version
39
39
  version: '0.3'
40
40
  type: :runtime
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
- - - ~>
44
+ - - "~>"
45
45
  - !ruby/object:Gem::Version
46
46
  version: '0.3'
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: sinatra-flash
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
- - - '>='
51
+ - - ">="
52
52
  - !ruby/object:Gem::Version
53
53
  version: '0'
54
54
  type: :runtime
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
- - - '>='
58
+ - - ">="
59
59
  - !ruby/object:Gem::Version
60
60
  version: '0'
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: haml
63
63
  requirement: !ruby/object:Gem::Requirement
64
64
  requirements:
65
- - - '>='
65
+ - - ">="
66
66
  - !ruby/object:Gem::Version
67
67
  version: '4.0'
68
- - - ~>
68
+ - - "~>"
69
69
  - !ruby/object:Gem::Version
70
70
  version: '5.0'
71
71
  type: :runtime
72
72
  prerelease: false
73
73
  version_requirements: !ruby/object:Gem::Requirement
74
74
  requirements:
75
- - - '>='
75
+ - - ">="
76
76
  - !ruby/object:Gem::Version
77
77
  version: '4.0'
78
- - - ~>
78
+ - - "~>"
79
79
  - !ruby/object:Gem::Version
80
80
  version: '5.0'
81
81
  - !ruby/object:Gem::Dependency
82
82
  name: activerecord
83
83
  requirement: !ruby/object:Gem::Requirement
84
84
  requirements:
85
- - - '>='
85
+ - - ">="
86
86
  - !ruby/object:Gem::Version
87
87
  version: '4.0'
88
- - - ~>
88
+ - - "~>"
89
89
  - !ruby/object:Gem::Version
90
90
  version: '5.0'
91
91
  type: :runtime
92
92
  prerelease: false
93
93
  version_requirements: !ruby/object:Gem::Requirement
94
94
  requirements:
95
- - - '>='
95
+ - - ">="
96
96
  - !ruby/object:Gem::Version
97
97
  version: '4.0'
98
- - - ~>
98
+ - - "~>"
99
99
  - !ruby/object:Gem::Version
100
100
  version: '5.0'
101
101
  - !ruby/object:Gem::Dependency
102
102
  name: activeresource
103
103
  requirement: !ruby/object:Gem::Requirement
104
104
  requirements:
105
- - - '>='
105
+ - - ">="
106
106
  - !ruby/object:Gem::Version
107
107
  version: '4.0'
108
- - - ~>
108
+ - - "~>"
109
109
  - !ruby/object:Gem::Version
110
110
  version: '5.0'
111
111
  type: :runtime
112
112
  prerelease: false
113
113
  version_requirements: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - '>='
115
+ - - ">="
116
116
  - !ruby/object:Gem::Version
117
117
  version: '4.0'
118
- - - ~>
118
+ - - "~>"
119
119
  - !ruby/object:Gem::Version
120
120
  version: '5.0'
121
121
  - !ruby/object:Gem::Dependency
122
122
  name: thin
123
123
  requirement: !ruby/object:Gem::Requirement
124
124
  requirements:
125
- - - ~>
125
+ - - "~>"
126
126
  - !ruby/object:Gem::Version
127
127
  version: '1.6'
128
128
  type: :runtime
129
129
  prerelease: false
130
130
  version_requirements: !ruby/object:Gem::Requirement
131
131
  requirements:
132
- - - ~>
132
+ - - "~>"
133
133
  - !ruby/object:Gem::Version
134
134
  version: '1.6'
135
135
  description:
@@ -141,24 +141,9 @@ extensions: []
141
141
  extra_rdoc_files: []
142
142
  files:
143
143
  - CHANGELOG
144
- - README.markdown
145
144
  - LICENSE
146
- - lib/rest-assured/api/app_session.rb
147
- - lib/rest-assured/api/resources.rb
148
- - lib/rest-assured/api/server.rb
149
- - lib/rest-assured/api.rb
150
- - lib/rest-assured/application.rb
151
- - lib/rest-assured/config.rb
152
- - lib/rest-assured/models/double.rb
153
- - lib/rest-assured/models/redirect.rb
154
- - lib/rest-assured/models/request.rb
155
- - lib/rest-assured/routes/double.rb
156
- - lib/rest-assured/routes/redirect.rb
157
- - lib/rest-assured/routes/response.rb
158
- - lib/rest-assured/utils/port_explorer.rb
159
- - lib/rest-assured/version.rb
160
- - lib/rest-assured.rb
161
- - lib/sinatra/partials.rb
145
+ - README.markdown
146
+ - bin/rest-assured
162
147
  - db/migrate/20110620161740_add_fixtures.rb
163
148
  - db/migrate/20110625155332_add_redirects_table.rb
164
149
  - db/migrate/20110709150645_add_description_to_fixtures.rb
@@ -175,6 +160,39 @@ files:
175
160
  - db/migrate/20170713000515_add_delay_to_doubles.rb
176
161
  - db/migrate/20170818001158_add_pathpattern_to_doubles.rb
177
162
  - db/test.db
163
+ - features/command_line_options.feature
164
+ - features/rest_api/doubles.feature
165
+ - features/rest_api/redirects.feature
166
+ - features/ruby_api/create_double.feature
167
+ - features/ruby_api/destroy_double.feature
168
+ - features/ruby_api/list_doubles.feature
169
+ - features/ruby_api/test_server.feature
170
+ - features/ruby_api/verify_requests.feature
171
+ - features/ruby_api/wait_for_requests.feature
172
+ - features/step_definitions/command_line_options_steps.rb
173
+ - features/step_definitions/doubles_steps.rb
174
+ - features/step_definitions/redirect_rules_steps.rb
175
+ - features/step_definitions/ruby_api_steps.rb
176
+ - features/support/env.rb
177
+ - features/support/world_helpers.rb
178
+ - features/web_ui/doubles.feature
179
+ - features/web_ui/redirects.feature
180
+ - lib/rest-assured.rb
181
+ - lib/rest-assured/api.rb
182
+ - lib/rest-assured/api/app_session.rb
183
+ - lib/rest-assured/api/resources.rb
184
+ - lib/rest-assured/api/server.rb
185
+ - lib/rest-assured/application.rb
186
+ - lib/rest-assured/config.rb
187
+ - lib/rest-assured/models/double.rb
188
+ - lib/rest-assured/models/redirect.rb
189
+ - lib/rest-assured/models/request.rb
190
+ - lib/rest-assured/routes/double.rb
191
+ - lib/rest-assured/routes/redirect.rb
192
+ - lib/rest-assured/routes/response.rb
193
+ - lib/rest-assured/utils/port_explorer.rb
194
+ - lib/rest-assured/version.rb
195
+ - lib/sinatra/partials.rb
178
196
  - public/css/base.css
179
197
  - public/css/grid.inuit.css
180
198
  - public/css/inuit.css
@@ -192,17 +210,6 @@ files:
192
210
  - public/javascript/application.js
193
211
  - public/javascript/jquery.jgrowl_minimized.js
194
212
  - public/javascript/jquery.simulate.drag-sortable.js
195
- - views/doubles/_form.haml
196
- - views/doubles/edit.haml
197
- - views/doubles/index.haml
198
- - views/doubles/new.haml
199
- - views/layout.haml
200
- - views/redirects/_form.haml
201
- - views/redirects/edit.haml
202
- - views/redirects/index.haml
203
- - views/redirects/new.haml
204
- - ssl/localhost.crt
205
- - ssl/localhost.key
206
213
  - spec/api/app_session_spec.rb
207
214
  - spec/api/resource_double_spec.rb
208
215
  - spec/api/server_spec.rb
@@ -217,24 +224,17 @@ files:
217
224
  - spec/spec_helper.rb
218
225
  - spec/support/custom_matchers.rb
219
226
  - spec/support/reset-singleton.rb
220
- - features/command_line_options.feature
221
- - features/rest_api/doubles.feature
222
- - features/rest_api/redirects.feature
223
- - features/ruby_api/create_double.feature
224
- - features/ruby_api/destroy_double.feature
225
- - features/ruby_api/list_doubles.feature
226
- - features/ruby_api/test_server.feature
227
- - features/ruby_api/verify_requests.feature
228
- - features/ruby_api/wait_for_requests.feature
229
- - features/step_definitions/command_line_options_steps.rb
230
- - features/step_definitions/doubles_steps.rb
231
- - features/step_definitions/redirect_rules_steps.rb
232
- - features/step_definitions/ruby_api_steps.rb
233
- - features/support/env.rb
234
- - features/support/world_helpers.rb
235
- - features/web_ui/doubles.feature
236
- - features/web_ui/redirects.feature
237
- - bin/rest-assured
227
+ - ssl/localhost.crt
228
+ - ssl/localhost.key
229
+ - views/doubles/_form.haml
230
+ - views/doubles/edit.haml
231
+ - views/doubles/index.haml
232
+ - views/doubles/new.haml
233
+ - views/layout.haml
234
+ - views/redirects/_form.haml
235
+ - views/redirects/edit.haml
236
+ - views/redirects/index.haml
237
+ - views/redirects/new.haml
238
238
  homepage: https://github.com/artemave/rest-assured
239
239
  licenses: []
240
240
  metadata: {}
@@ -244,49 +244,49 @@ require_paths:
244
244
  - lib
245
245
  required_ruby_version: !ruby/object:Gem::Requirement
246
246
  requirements:
247
- - - '>='
247
+ - - ">="
248
248
  - !ruby/object:Gem::Version
249
249
  version: 2.2.2
250
250
  required_rubygems_version: !ruby/object:Gem::Requirement
251
251
  requirements:
252
- - - '>='
252
+ - - ">="
253
253
  - !ruby/object:Gem::Version
254
254
  version: '0'
255
255
  requirements: []
256
256
  rubyforge_project: rest-assured
257
- rubygems_version: 2.0.14.1
257
+ rubygems_version: 2.6.11
258
258
  signing_key:
259
259
  specification_version: 4
260
260
  summary: Real stubs and spies for HTTP(S) services
261
261
  test_files:
262
- - spec/api/app_session_spec.rb
263
- - spec/api/resource_double_spec.rb
264
- - spec/api/server_spec.rb
262
+ - spec/spec_helper.rb
265
263
  - spec/config_spec.rb
266
- - spec/functional/double_routes_spec.rb
267
- - spec/functional/redirect_routes_spec.rb
268
- - spec/functional/response_spec.rb
269
264
  - spec/models/double_spec.rb
270
265
  - spec/models/redirect_spec.rb
271
266
  - spec/models/request_spec.rb
272
- - spec/port_explorer_spec.rb
273
- - spec/spec_helper.rb
274
- - spec/support/custom_matchers.rb
275
267
  - spec/support/reset-singleton.rb
276
- - features/command_line_options.feature
277
- - features/rest_api/doubles.feature
278
- - features/rest_api/redirects.feature
268
+ - spec/support/custom_matchers.rb
269
+ - spec/api/app_session_spec.rb
270
+ - spec/api/server_spec.rb
271
+ - spec/api/resource_double_spec.rb
272
+ - spec/functional/redirect_routes_spec.rb
273
+ - spec/functional/response_spec.rb
274
+ - spec/functional/double_routes_spec.rb
275
+ - spec/port_explorer_spec.rb
276
+ - features/ruby_api/wait_for_requests.feature
277
+ - features/ruby_api/list_doubles.feature
278
+ - features/ruby_api/verify_requests.feature
279
279
  - features/ruby_api/create_double.feature
280
280
  - features/ruby_api/destroy_double.feature
281
- - features/ruby_api/list_doubles.feature
282
281
  - features/ruby_api/test_server.feature
283
- - features/ruby_api/verify_requests.feature
284
- - features/ruby_api/wait_for_requests.feature
285
- - features/step_definitions/command_line_options_steps.rb
286
- - features/step_definitions/doubles_steps.rb
287
- - features/step_definitions/redirect_rules_steps.rb
288
- - features/step_definitions/ruby_api_steps.rb
289
282
  - features/support/env.rb
290
283
  - features/support/world_helpers.rb
291
- - features/web_ui/doubles.feature
292
284
  - features/web_ui/redirects.feature
285
+ - features/web_ui/doubles.feature
286
+ - features/step_definitions/command_line_options_steps.rb
287
+ - features/step_definitions/ruby_api_steps.rb
288
+ - features/step_definitions/redirect_rules_steps.rb
289
+ - features/step_definitions/doubles_steps.rb
290
+ - features/command_line_options.feature
291
+ - features/rest_api/redirects.feature
292
+ - features/rest_api/doubles.feature