cucumber-blendle-steps 0.3.2 → 0.4.0
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.md +3 -0
- data/cucumber-blendle-steps.gemspec +1 -0
- data/lib/cucumber/blendle/steps/benchmark_steps.rb +24 -0
- data/lib/cucumber/blendle/steps/resource_steps.rb +13 -13
- data/lib/cucumber/blendle/steps/rest_steps.rb +7 -7
- data/lib/cucumber/blendle/version.rb +1 -1
- data/lib/cucumber/blendle_steps.rb +1 -0
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 06b97b7cbad119afd760ba26ad67f62439c70ed8
|
4
|
+
data.tar.gz: a5b20e8b46e36f233c013c0ca016852e8dfde6d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 96e16bc8fcfb613715645effd1cd354d95de359648a289248cad716bc36d3c1add74569d5c26a34340cef96c4270ca05b6828679e50b8c6a5c2d4f933daeaa41
|
7
|
+
data.tar.gz: 19dfd2789536939317ed21873efa9ffcf631b123e317d051ae9ac5a9c50e18f1447ef7b6425953de62e372139567eb421f9bad41e18d163204ef97760135fa76
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
## [v0.3.2](https://github.com/blendle/cucumber-blendle-steps/tree/v0.3.2) (2015-12-12)
|
4
|
+
[Full Changelog](https://github.com/blendle/cucumber-blendle-steps/compare/v0.3.1...v0.3.2)
|
5
|
+
|
3
6
|
## [v0.3.1](https://github.com/blendle/cucumber-blendle-steps/tree/v0.3.1) (2015-12-12)
|
4
7
|
[Full Changelog](https://github.com/blendle/cucumber-blendle-steps/compare/v0.3.0...v0.3.1)
|
5
8
|
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'typhoeus'
|
2
|
+
|
3
|
+
def last_requests # rubocop:disable Style/TrivialAccessors
|
4
|
+
@last_requests
|
5
|
+
end
|
6
|
+
|
7
|
+
# * When the client does 1000 concurrent GET request to "https://example.org/items"
|
8
|
+
#
|
9
|
+
When(/^the client does (\d+) concurrent GET requests to "([^"]*)"$/) do |count, url|
|
10
|
+
hydra = Typhoeus::Hydra.new
|
11
|
+
@last_requests = count.to_i.times.map do
|
12
|
+
request = Typhoeus::Request.new(url, followlocation: true)
|
13
|
+
hydra.queue(request)
|
14
|
+
request
|
15
|
+
end
|
16
|
+
|
17
|
+
hydra.run
|
18
|
+
|
19
|
+
@last_requests.map!(&:response)
|
20
|
+
end
|
21
|
+
|
22
|
+
Then(/^all requests should have succeeded$/) do
|
23
|
+
last_requests.map(&:code).any? { |status| status.to_s[0] != 2 }
|
24
|
+
end
|
@@ -39,13 +39,13 @@ When(/^the client does a (GET|POST|DELETE) request to the "([^"]*)" resource wit
|
|
39
39
|
step %(the client does a #{method} request to "#{url}")
|
40
40
|
end
|
41
41
|
|
42
|
-
# When the client does a POST request to the "items" resource with the following content:
|
43
|
-
#
|
44
|
-
#
|
45
|
-
#
|
46
|
-
#
|
47
|
-
#
|
48
|
-
#
|
42
|
+
# * When the client does a POST request to the "items" resource with the following content:
|
43
|
+
# """json
|
44
|
+
# {
|
45
|
+
# "uid": "hello",
|
46
|
+
# "price": 100
|
47
|
+
# }
|
48
|
+
# """
|
49
49
|
#
|
50
50
|
When(/^the client does a (GET|POST|DELETE) request to the "([^"]*)" resource with the following content:$/) do |method, resource, content|
|
51
51
|
body = JSON.parse(get('/api').body)
|
@@ -55,12 +55,12 @@ When(/^the client does a (GET|POST|DELETE) request to the "([^"]*)" resource wit
|
|
55
55
|
step %(the client does a #{method} request to "#{url}" with the following content:), content
|
56
56
|
end
|
57
57
|
|
58
|
-
# When the client does a PUT request to the "item" resource with the template variable "item_uid" set to "hello" and the following content:
|
59
|
-
#
|
60
|
-
#
|
61
|
-
#
|
62
|
-
#
|
63
|
-
#
|
58
|
+
# * When the client does a PUT request to the "item" resource with the template variable "item_uid" set to "hello" and the following content:
|
59
|
+
# """json
|
60
|
+
# {
|
61
|
+
# "price": 10
|
62
|
+
# }
|
63
|
+
# """
|
64
64
|
#
|
65
65
|
When(/^the client does a (POST|PUT) request to the "([^"]*)" resource with the template variable "([^"]*)" set to "([^"]*)" and the following content:$/) do |method, resource, key, value, content|
|
66
66
|
body = JSON.parse(get('/api').body)
|
@@ -44,16 +44,16 @@ end
|
|
44
44
|
|
45
45
|
# * Then the response should contain the header "Location" with value "https://example.org/item/hello"
|
46
46
|
#
|
47
|
-
Then(
|
47
|
+
Then(/^the response should contain the header "([^"]*)" with value "([^"]*)"$/) do |header, value|
|
48
48
|
assert_equal last_response.headers[header], value
|
49
49
|
end
|
50
50
|
|
51
|
-
# Then the response should be of type "application/json" with content:
|
52
|
-
#
|
53
|
-
#
|
54
|
-
#
|
55
|
-
#
|
56
|
-
#
|
51
|
+
# * Then the response should be of type "application/json" with content:
|
52
|
+
# """json
|
53
|
+
# {
|
54
|
+
# "uid": "hello"
|
55
|
+
# }
|
56
|
+
# """
|
57
57
|
#
|
58
58
|
Then(/^the response should be of type "([^"]*)" with content:$/) do |content_type, content|
|
59
59
|
dump last_response.body
|
@@ -4,6 +4,7 @@ require 'cucumber/blendle/support/json_spec'
|
|
4
4
|
require 'cucumber/blendle/support/minitest'
|
5
5
|
require 'cucumber/blendle/support/rack_test'
|
6
6
|
|
7
|
+
require 'cucumber/blendle/steps/benchmark_steps'
|
7
8
|
require 'cucumber/blendle/steps/model_steps'
|
8
9
|
require 'cucumber/blendle/steps/resource_steps'
|
9
10
|
require 'cucumber/blendle/steps/rest_steps'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cucumber-blendle-steps
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jean Mertz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -150,6 +150,20 @@ dependencies:
|
|
150
150
|
- - ">="
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: typhoeus
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ">="
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
type: :runtime
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ">="
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
153
167
|
- !ruby/object:Gem::Dependency
|
154
168
|
name: bundler
|
155
169
|
requirement: !ruby/object:Gem::Requirement
|
@@ -250,6 +264,7 @@ files:
|
|
250
264
|
- README.md
|
251
265
|
- Rakefile
|
252
266
|
- cucumber-blendle-steps.gemspec
|
267
|
+
- lib/cucumber/blendle/steps/benchmark_steps.rb
|
253
268
|
- lib/cucumber/blendle/steps/model_steps.rb
|
254
269
|
- lib/cucumber/blendle/steps/resource_steps.rb
|
255
270
|
- lib/cucumber/blendle/steps/rest_steps.rb
|
@@ -284,4 +299,3 @@ signing_key:
|
|
284
299
|
specification_version: 4
|
285
300
|
summary: Cucumber steps used by all of Blendle Ruby projects
|
286
301
|
test_files: []
|
287
|
-
has_rdoc:
|