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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7c409b31ccbcf91050864f00ea6e100d1f3e59a1
4
- data.tar.gz: 03550d41613abbbf9715bbeda2d2b6eaac102b1a
3
+ metadata.gz: 06b97b7cbad119afd760ba26ad67f62439c70ed8
4
+ data.tar.gz: a5b20e8b46e36f233c013c0ca016852e8dfde6d3
5
5
  SHA512:
6
- metadata.gz: f964fafa9b6362d9f36b9c4867f31ddd152715f13275b0a1968a2e1d86be2fd7b9d291dc0c389395d063e39eef71e1521acb2bc724c4648b52c516010bd0db75
7
- data.tar.gz: c244dbf3983fa87640b0c112eac80ee64730ecc79e019dbeac9c21bed81d9eb619a70c6ea2efc37141267b79727494de9cf1b9a3383c602d4112b1c24ad178a6
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
 
@@ -26,6 +26,7 @@ Gem::Specification.new do |spec|
26
26
  spec.add_dependency 'rack'
27
27
  spec.add_dependency 'rspec-expectations'
28
28
  spec.add_dependency 'sequel'
29
+ spec.add_dependency 'typhoeus'
29
30
 
30
31
  spec.add_development_dependency 'bundler'
31
32
  spec.add_development_dependency 'pry'
@@ -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
- # """json
44
- # {
45
- # "uid": "hello",
46
- # "price": 100
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
- # """json
60
- # {
61
- # "price": 10
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('the response should contain the header "$" with value "$"') do |header, value|
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
- # """json
53
- # {
54
- # "uid": "hello"
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,6 @@ module Cucumber
4
4
  # This module defines default steps used by all of Blendle Ruby projects.
5
5
  #
6
6
  module BlendleSteps
7
- VERSION = '0.3.2'
7
+ VERSION = '0.4.0'
8
8
  end
9
9
  end
@@ -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.3.2
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: 2015-12-12 00:00:00.000000000 Z
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: