cucumber-rest-bdd 0.4.3 → 0.4.4.pre.124
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Dockerfile +1 -1
- data/cucumber-rest-bdd.gemspec +1 -1
- data/features/functional.feature +4 -0
- data/lib/cucumber-rest-bdd/steps/functional.rb +7 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb615fea4da2428d0bb99748c5095c18f7d6b11f
|
4
|
+
data.tar.gz: d94194a9a2f89a51ce610d206e2c801152b98261
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb7b8b2539ce1d5fc8907c667376a49f62e795552cf5fde3ba469f1e0ba3ccdb19dd77e0ee150176c60499554e6837a96f53b8c83a0f4b9fb86a5a3622cb077c
|
7
|
+
data.tar.gz: 39309d24870a52c17a13306fb49ad64190cc0887f349934c21f6a2181f362e77c974bd28fa6d508ff8fa4988ce86a85d15a35d3f3a1d1b2f3b57c88bdcc52b73
|
data/Dockerfile
CHANGED
data/cucumber-rest-bdd.gemspec
CHANGED
data/features/functional.feature
CHANGED
@@ -7,7 +7,11 @@ Feature: Performing different rest methods
|
|
7
7
|
When I request a list of posts with:
|
8
8
|
| User Id | 8 |
|
9
9
|
Then the request is successful
|
10
|
+
And the JSON response should have "$." of type array with at least 1 entry
|
11
|
+
And the JSON response should have "$." of type array with at least 10 entries
|
10
12
|
And the JSON response should have "$." of type array with 10 entries
|
13
|
+
And the JSON response should have "$." of type array with at most 10 entries
|
14
|
+
And the JSON response should have "$." of type array with at most 11 entries
|
11
15
|
|
12
16
|
Scenario: Check for null type
|
13
17
|
When I request to create a post with:
|
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'cucumber-api/response'
|
2
2
|
require 'cucumber-api/steps'
|
3
|
+
require 'cucumber-rest-bdd/types'
|
3
4
|
|
4
5
|
Then(/^the response (?:should have|has a|has the) header "([^"]*)" with (?:a |the )?value "([^"]*)"$/) do |header, value|
|
5
6
|
p_value = resolve(value)
|
@@ -14,6 +15,12 @@ Then(/^the JSON response should have "([^"]*)" of type array with (\d+) entr(?:y
|
|
14
15
|
raise %/Expected #{number} items in array for path '#{json_path}', found: #{list.count}\n#{@response.to_json_s}/ if list.count != number.to_i
|
15
16
|
end
|
16
17
|
|
18
|
+
Then(/^the JSON response should have "([^"]*)" of type array with (#{FEWER_MORE_THAN}) (\d+) entr(?:y|ies)$/) do |json_path, count_mod, number|
|
19
|
+
list = @response.get_as_type json_path, 'array'
|
20
|
+
raise %/Expected #{count_mod} #{number} items in array for path '#{json_path}', found: #{list.count}\n#{@response.to_json_s}/ \
|
21
|
+
if !num_compare(count_mod, list.count, number.to_i)
|
22
|
+
end
|
23
|
+
|
17
24
|
Then(/^the JSON response should have "([^"]*)" of type (.+) that matches "(.+)"$/) do |json_path, type, regex|
|
18
25
|
value = @response.get_as_type json_path, type
|
19
26
|
raise %/Expected #{json_path} value '#{value}' to match regex: #{regex}\n#{@response.to_json_s}/ if (Regexp.new(regex) =~ value).nil?
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cucumber-rest-bdd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.4.pre.124
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Harry Bragg
|
@@ -104,9 +104,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
104
104
|
version: '0'
|
105
105
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
106
106
|
requirements:
|
107
|
-
- - "
|
107
|
+
- - ">"
|
108
108
|
- !ruby/object:Gem::Version
|
109
|
-
version:
|
109
|
+
version: 1.3.1
|
110
110
|
requirements: []
|
111
111
|
rubyforge_project:
|
112
112
|
rubygems_version: 2.4.8
|