cucumber-http 0.7.0 → 0.7.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/cucumber/http/configuration.rb +7 -0
- data/lib/cucumber/http/http_steps.rb +3 -5
- data/lib/cucumber/http/version.rb +1 -1
- data/lib/cucumber/http.rb +9 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: ad029283d163bcff1a85fa26cdeb79a6adc8fb6e
|
4
|
+
data.tar.gz: 99361e0d01175c116e4576a8a4009ffbd1c90393
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 667aa9ec423d499a1c7cc8cbbc85a13f03cff79188e835f30b3fe72c9d013f4110e2006a64c3226fc1f789e6f980d36978a7bdac68743e85cf4ef6b2a7fa4eda
|
7
|
+
data.tar.gz: b85ef6db88edefad989d85b7a662e0ca8bbb7a14ede2641d8f61dc45f07dbdac1cb383106ac56914f0b3f8ca00b25445ec4813948acb30d51437af9259cdedf7
|
@@ -1,5 +1,3 @@
|
|
1
|
-
require 'json_spec'
|
2
|
-
|
3
1
|
Given /^I set headers?:$/ do |hdrs|
|
4
2
|
hdrs.rows_hash.each { |name, value| add_header(name, value) }
|
5
3
|
end
|
@@ -59,7 +57,7 @@ Given(/^I set the JSON request payload to:$/) do |payload|
|
|
59
57
|
end
|
60
58
|
|
61
59
|
Given(/^I set the JSON request payload from "(.*?)"$/) do |filename|
|
62
|
-
path = "#{
|
60
|
+
path = "#{Cucumber::Http.data_directory}/#{filename}"
|
63
61
|
|
64
62
|
if File.file? path
|
65
63
|
set_payload(JSON.parse(resolve(File.read(path))).to_json)
|
@@ -89,7 +87,7 @@ When /^I send a (GET|POST|PATCH|PUT|DELETE) request to "([^"]*)"(?: with paramet
|
|
89
87
|
params_hash = Hash[params.split('&').inject([]) { |result, param| result << param.split('=') }]
|
90
88
|
end
|
91
89
|
|
92
|
-
params_hash.each { |name, value| add_parameter(name, value) }
|
90
|
+
params_hash.each { |name, value| add_parameter(name, resolve(value)) }
|
93
91
|
end
|
94
92
|
|
95
93
|
perform_request(method, request_url)
|
@@ -98,7 +96,7 @@ end
|
|
98
96
|
When 'I upload {string} from path {string} to {string}' do |key, filename, endpoint|
|
99
97
|
method = 'post'
|
100
98
|
payload_key = key
|
101
|
-
path = "#{
|
99
|
+
path = "#{Cucumber::Http.data_directory}/#{filename}"
|
102
100
|
|
103
101
|
request_url = URI.join(url, URI::encode(endpoint)).to_s
|
104
102
|
|
data/lib/cucumber/http.rb
CHANGED
@@ -3,3 +3,12 @@ require 'cucumber/http/hooks'
|
|
3
3
|
require 'cucumber/http/http_steps'
|
4
4
|
require 'cucumber/http/benchmark_steps'
|
5
5
|
require 'cucumber/http/debug_steps'
|
6
|
+
require 'cucumber/http/configuration'
|
7
|
+
require 'json_spec'
|
8
|
+
require 'json_spec/cucumber'
|
9
|
+
|
10
|
+
module Cucumber
|
11
|
+
module Http
|
12
|
+
extend Configuration
|
13
|
+
end
|
14
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cucumber-http
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kristof Willaert
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-10-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cucumber
|
@@ -104,6 +104,7 @@ files:
|
|
104
104
|
- README.md
|
105
105
|
- lib/cucumber/http.rb
|
106
106
|
- lib/cucumber/http/benchmark_steps.rb
|
107
|
+
- lib/cucumber/http/configuration.rb
|
107
108
|
- lib/cucumber/http/debug_steps.rb
|
108
109
|
- lib/cucumber/http/hooks.rb
|
109
110
|
- lib/cucumber/http/http_steps.rb
|
@@ -136,7 +137,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
136
137
|
- !ruby/object:Gem::Version
|
137
138
|
version: '0'
|
138
139
|
requirements: []
|
139
|
-
|
140
|
+
rubyforge_project:
|
141
|
+
rubygems_version: 2.6.8
|
140
142
|
signing_key:
|
141
143
|
specification_version: 4
|
142
144
|
summary: Cucumber steps to easily test JSON APIs
|