cucoo 0.0.5 → 0.0.6
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/lib/cucoo/cucumber.rb +23 -19
- data/lib/cucoo/version.rb +1 -1
- metadata +1 -2
- data/lib/cucoo/api.rb +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cfb4667f509752bb120b6e7bdff086d00e82340b
|
4
|
+
data.tar.gz: f14338ffc157bf8dbf5ba09719fa99c0ef46ab9c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 55b7d1a3b5d035ec3b9fa3dd73479983e234572757b22eea5970426a46639bf048a5e0e7c9015be655d02424d7e0db47384335683bef30d78d61e0e0f2654f15
|
7
|
+
data.tar.gz: 55a355192882fb7e0749724a8c5c3df713e3ea2bf6593e70c15c1d3219d41be192b951e2afef01024e9ac630a17dd1d9ddc5e8a83f75b920cea052a359f34a31
|
data/lib/cucoo/cucumber.rb
CHANGED
@@ -4,86 +4,90 @@ def last_json
|
|
4
4
|
end
|
5
5
|
|
6
6
|
#API Steps
|
7
|
-
When
|
7
|
+
When /^I make a POST to "([^"]*)" with:$/ do |url, params|
|
8
8
|
Cucoo::Driver.post url, params.hashes.first
|
9
9
|
end
|
10
10
|
|
11
|
-
When
|
11
|
+
When /^I make a POST to "([^"]*)"$/ do |url|
|
12
12
|
Cucoo::Driver.post url
|
13
13
|
end
|
14
14
|
|
15
|
-
When
|
15
|
+
When /^I make a POST to "([^"]*)" with headers "([^"]*)" and the following params:$/ do |url, headers, params|
|
16
16
|
header, value = headers.split(':')
|
17
17
|
Cucoo::Driver.post_with_header url, {header => value, 'Content-type' => 'text/plain; charset=UTF-8'}, params.hashes.first.to_json
|
18
18
|
end
|
19
19
|
|
20
|
-
When
|
20
|
+
When /^I make a GET to "([^"]*)"$/ do |url|
|
21
21
|
Cucoo::Driver.get url
|
22
22
|
end
|
23
23
|
|
24
|
-
When
|
24
|
+
When /^I make a DELETE to "([^"]*)"$/ do |url|
|
25
25
|
Cucoo::Driver.delete url
|
26
26
|
end
|
27
27
|
|
28
|
-
When
|
28
|
+
When /^I make a DELETE to "([^"]*)" with:$/ do |url, params|
|
29
29
|
Cucoo::Driver.delete url, params.hashes.first
|
30
30
|
end
|
31
31
|
|
32
|
-
And
|
32
|
+
And /^the response error message should be "([^"]*)"$/ do |message|
|
33
33
|
expect(Cucoo::Driver.response['error']).to eq(message)
|
34
34
|
end
|
35
35
|
|
36
|
-
And
|
36
|
+
And /^the response body must be "([^"]*)"$/ do |body|
|
37
37
|
expect(Cucoo::Driver.response.to_s).to eq(body)
|
38
38
|
end
|
39
39
|
|
40
|
-
When
|
40
|
+
When /^I send a PUT request to "([^"]*)" with:$/ do |url, params|
|
41
41
|
Cucoo::Driver.put url, params.hashes.first
|
42
42
|
end
|
43
43
|
|
44
44
|
# Stub Steps
|
45
|
-
Given
|
45
|
+
Given /^I expect a POST to "([^"]*)" with:$/ do |url, table|
|
46
46
|
params = table.hashes.first
|
47
47
|
stub_my_request(:post, url, params)
|
48
48
|
end
|
49
49
|
|
50
|
-
Given
|
50
|
+
Given /^I expect a POST to "([^"]*)" with json request:$/ do |url, json|
|
51
51
|
stub_my_request(:post, url, {request: JSON.parse(json)})
|
52
52
|
end
|
53
53
|
|
54
|
-
Given
|
54
|
+
Given /^I expect a PUT to "([^"]*)" with json request:$/ do |url, json|
|
55
55
|
stub_my_request(:put, url, {request: JSON.parse(json)})
|
56
56
|
end
|
57
57
|
|
58
|
-
And
|
58
|
+
And /^I expect a GET to "([^"]*)" with:$/ do |url, table|
|
59
59
|
params = table.hashes.first
|
60
60
|
stub_my_request(:get, url, params)
|
61
61
|
end
|
62
62
|
|
63
|
-
|
63
|
+
And /^I expect a GET to "([^"]*)" with json response:$/ do |url, json|
|
64
|
+
stub_my_request(:get, url, {response: json})
|
65
|
+
end
|
66
|
+
|
67
|
+
Given /^I expect a GET to "([^"]*)" and return NOT FOUND$/ do |url|
|
64
68
|
stub_my_request(:get, url, {status: 404})
|
65
69
|
end
|
66
70
|
|
67
|
-
And
|
71
|
+
And /^I expect a DELETE to "([^"]*)"$/ do |url|
|
68
72
|
stub_my_request(:delete, url, {})
|
69
73
|
end
|
70
74
|
|
71
|
-
Then
|
75
|
+
Then /^the response should be OK$/ do
|
72
76
|
expect(Cucoo::Driver.response.code).to be_between(200, 201).inclusive
|
73
77
|
assert_all_stubs!
|
74
78
|
end
|
75
79
|
|
76
|
-
Then
|
80
|
+
Then /^the response should be NOT FOUND$/ do
|
77
81
|
expect(Cucoo::Driver.response.code).to eq(404)
|
78
82
|
assert_all_stubs!
|
79
83
|
end
|
80
84
|
|
81
|
-
Then
|
85
|
+
Then /^the response should be BAD REQUEST$/ do
|
82
86
|
expect(Cucoo::Driver.response.code).to eq(400)
|
83
87
|
assert_all_stubs!
|
84
88
|
end
|
85
89
|
|
86
|
-
Then
|
90
|
+
Then /^the response code should be "([^"]*)"$/ do |code|
|
87
91
|
expect(Cucoo::Driver.response.code).to eq(code.to_i)
|
88
92
|
assert_all_stubs!
|
89
93
|
end
|
data/lib/cucoo/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cucoo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- RC
|
@@ -213,7 +213,6 @@ files:
|
|
213
213
|
- features/get.feature
|
214
214
|
- features/support/env.rb
|
215
215
|
- lib/cucoo.rb
|
216
|
-
- lib/cucoo/api.rb
|
217
216
|
- lib/cucoo/api_driver.rb
|
218
217
|
- lib/cucoo/config.rb
|
219
218
|
- lib/cucoo/cucumber.rb
|
data/lib/cucoo/api.rb
DELETED
File without changes
|