cucumber-api 0.6 → 0.7

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: 7392b8644d8388d322683235667d3d187c5a23f2
4
- data.tar.gz: 2f9f4d4d4d2364fcd6ea7e4e134aecd5a36c4757
3
+ metadata.gz: 58a6004ffba95c36be83a6387b5cccb7ef4ffd02
4
+ data.tar.gz: 7533b5f37df30a1688ac9771c7a62d45bbf16bcb
5
5
  SHA512:
6
- metadata.gz: efe05026c75a06809c9d7e44652c6038ee984a5dc56d3ebf2780c354524c481bbae165bcf91359704eaac959a712e4d7c6ff6b7a29c36e5980618482d8d20847
7
- data.tar.gz: b88b5bbf06f9aab8df365b599caefe0f3d37fc8fcbbbb31dae854ac29396ee8a27ab66c0591edd0bc091fe77672b4b9e692d43546b8f4a1c7ba2984ed2188b4f
6
+ metadata.gz: d17fce9a70de89976349b12b9d412d736b30737f5f8f6fea6d2d70d3d5b9782c0b76925bdf529eba90e7b00dfe054a6cadd7c927b7c58526eff5da122f56d96c
7
+ data.tar.gz: 614efc58ed2d28cb8f94cb4117f77d8ae5c04c6a650d7b71cea5f39e0e086651cbdf5434f50a2a409aacfa7a76e41acbea644002d958bd3804883143f1278c6b
data/README.md CHANGED
@@ -176,6 +176,12 @@ Response caching is provided for GET requests by default. This is useful when yo
176
176
 
177
177
  Only the first request to that endpoint is made, subsequent requests will use cached response. Response caching is only available for GET method.
178
178
 
179
+ The response cache can also be cleared if needed:
180
+
181
+ ```gherkin
182
+ Given I clear the response cache
183
+ ```
184
+
179
185
  ## Dependencies
180
186
  * [cucumber](https://github.com/cucumber/cucumber) for BDD style specs
181
187
  * [jsonpath](https://github.com/joshbuddy/jsonpath) for traversal of JSON response via [JSON path](http://goessner.net/articles/JsonPath/)
@@ -1,17 +1,18 @@
1
1
  # https://github.com/HackerNews/API
2
2
  Feature: Hacker News REST API validation
3
3
 
4
- Scenario: Verify top stories JSON schema
4
+ Background:
5
5
  Given I send and accept JSON
6
- And I add Headers:
6
+
7
+ Scenario: Verify top stories JSON schema
8
+ When I add Headers:
7
9
  | Cache-Control | no-cache |
8
- When I send a GET request to "https://hacker-news.firebaseio.com/v0/topstories.json?print=pretty"
10
+ And I send a GET request to "https://hacker-news.firebaseio.com/v0/topstories.json?print=pretty"
9
11
  Then the response status should be "200"
10
12
  And the JSON response should follow "features/schemas/topstories.json"
11
13
 
12
14
  Scenario Outline: Verify item JSON schema
13
- When I send and accept JSON
14
- And I send a GET request to "https://hacker-news.firebaseio.com/v0/topstories.json?print=pretty"
15
+ When I send a GET request to "https://hacker-news.firebaseio.com/v0/topstories.json?print=pretty"
15
16
  Then the response status should be "200"
16
17
  And the JSON response root should be array
17
18
  When I grab "$[0]" as "id"
@@ -30,8 +31,7 @@ Feature: Hacker News REST API validation
30
31
  | url | string | optional |
31
32
 
32
33
  Scenario: Demonstrate setting the JSON body with a docstring
33
- Given I send and accept JSON
34
- And I set JSON request body to:
34
+ When I set JSON request body to:
35
35
  """
36
36
  {
37
37
  "title": "foo",
@@ -39,7 +39,7 @@ Feature: Hacker News REST API validation
39
39
  "userId": 1
40
40
  }
41
41
  """
42
- When I send a POST request to "http://jsonplaceholder.typicode.com/posts"
42
+ And I send a POST request to "http://jsonplaceholder.typicode.com/posts"
43
43
  Then the response status should be "201"
44
44
  And the JSON response should have "id" of type numeric and value "101"
45
45
  And the JSON response should have "title" of type string and value "foo"
@@ -9,6 +9,10 @@ end
9
9
 
10
10
  $cache = {}
11
11
 
12
+ Given(/^I clear the response cache$/) do
13
+ $cache = {}
14
+ end
15
+
12
16
  Given(/^I send and accept JSON$/) do
13
17
  steps %Q{
14
18
  Given I send "application/json" and accept JSON
@@ -1,3 +1,3 @@
1
1
  module CucumberApi
2
- VERSION = "0.6"
2
+ VERSION = "0.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cucumber-api
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.6'
4
+ version: '0.7'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ha Duy Trung
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-08 00:00:00.000000000 Z
11
+ date: 2018-08-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable