cucoo 0.0.2 → 0.0.3
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/api.rb +0 -0
- data/lib/cucoo/{step_definitions/stub_steps.rb → cucumber.rb} +44 -0
- data/lib/cucoo/rails.rb +1 -3
- data/lib/cucoo/version.rb +1 -1
- metadata +3 -4
- data/lib/cucoo/step_definitions/api_steps.rb +0 -37
- data/lib/cucoo/step_definitions/json_spec_steps.rb +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1e39585ef2d97c0a9beeabb30cea534c7e9c7ef
|
4
|
+
data.tar.gz: f29132292fc8b6df5235b02b8accc4d0505dccb9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b52dc53a5e0765f3d8fd12c71da2fdecfd9aa86a8dc44f4621dcedc738093c86d4b01187a76c5ee0b2c225aa717a90eb93712baddd8d575ab69085ac13a0ad5
|
7
|
+
data.tar.gz: 09084ed38a53025059c3c95be893d23d1a9e2faf0e42b2d245e24b9254d558750c8d553ff3bdbbff2f2424ef37c072dec64ef5a531e9b682cdc5b455e4264792
|
data/lib/cucoo/api.rb
ADDED
File without changes
|
@@ -1,3 +1,47 @@
|
|
1
|
+
#json_spec steps
|
2
|
+
def last_json
|
3
|
+
Cucoo::Driver.response.body
|
4
|
+
end
|
5
|
+
|
6
|
+
#API Steps
|
7
|
+
When(/^I make a POST to "([^"]*)" with:$/) do |url, params|
|
8
|
+
Cucoo::Driver.post url, params.hashes.first
|
9
|
+
end
|
10
|
+
|
11
|
+
When(/^I make a POST to "([^"]*)"$/) do |url|
|
12
|
+
Cucoo::Driver.post url
|
13
|
+
end
|
14
|
+
|
15
|
+
When(/^I make a POST to "([^"]*)" with headers "([^"]*)" and the following params:$/) do |url, headers, params|
|
16
|
+
header, value = headers.split(':')
|
17
|
+
Cucoo::Driver.post_with_header url, {header => value, 'Content-type' => 'text/plain; charset=UTF-8'}, params.hashes.first.to_json
|
18
|
+
end
|
19
|
+
|
20
|
+
When(/^I make a GET to "([^"]*)"$/) do |url|
|
21
|
+
Cucoo::Driver.get url
|
22
|
+
end
|
23
|
+
|
24
|
+
When(/^I make a DELETE to "([^"]*)"$/) do |url|
|
25
|
+
Cucoo::Driver.delete url
|
26
|
+
end
|
27
|
+
|
28
|
+
When(/^I make a DELETE to "([^"]*)" with:$/) do |url, params|
|
29
|
+
Cucoo::Driver.delete url, params.hashes.first
|
30
|
+
end
|
31
|
+
|
32
|
+
And(/^the response error message should be "([^"]*)"$/) do |message|
|
33
|
+
expect(Cucoo::Driver.response['error']).to eq(message)
|
34
|
+
end
|
35
|
+
|
36
|
+
And(/^the response body must be "([^"]*)"$/) do |body|
|
37
|
+
expect(Cucoo::Driver.response.to_s).to eq(body)
|
38
|
+
end
|
39
|
+
|
40
|
+
When(/^I send a PUT request to "([^"]*)" with:$/) do |url, params|
|
41
|
+
Cucoo::Driver.put url, params.hashes.first
|
42
|
+
end
|
43
|
+
|
44
|
+
# Stub Steps
|
1
45
|
Given(/^I expect a POST to "([^"]*)" with:$/) do |url, table|
|
2
46
|
params = table.hashes.first
|
3
47
|
stub_my_request(:post, url, params)
|
data/lib/cucoo/rails.rb
CHANGED
@@ -4,9 +4,7 @@ require 'webmock/cucumber'
|
|
4
4
|
require 'cucumber/rails'
|
5
5
|
require 'rspec/mocks'
|
6
6
|
require 'cucoo/stub_helper'
|
7
|
-
require 'cucoo/
|
8
|
-
require 'cucoo/step_definitions/stub_steps'
|
9
|
-
require 'cucoo/step_definitions/json_spec_steps'
|
7
|
+
require 'cucoo/cucumber'
|
10
8
|
|
11
9
|
Before do
|
12
10
|
clear_stubs!
|
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.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- RC
|
@@ -166,12 +166,11 @@ files:
|
|
166
166
|
- Rakefile
|
167
167
|
- cucoo.gemspec
|
168
168
|
- lib/cucoo.rb
|
169
|
+
- lib/cucoo/api.rb
|
169
170
|
- lib/cucoo/api_driver.rb
|
170
171
|
- lib/cucoo/config.rb
|
172
|
+
- lib/cucoo/cucumber.rb
|
171
173
|
- lib/cucoo/rails.rb
|
172
|
-
- lib/cucoo/step_definitions/api_steps.rb
|
173
|
-
- lib/cucoo/step_definitions/json_spec_steps.rb
|
174
|
-
- lib/cucoo/step_definitions/stub_steps.rb
|
175
174
|
- lib/cucoo/stub_helper.rb
|
176
175
|
- lib/cucoo/version.rb
|
177
176
|
homepage: https://github.com/rcdexta/cucoo
|
@@ -1,37 +0,0 @@
|
|
1
|
-
When(/^I make a POST to "([^"]*)" with:$/) do |url, params|
|
2
|
-
Cucoo::Driver.post url, params.hashes.first
|
3
|
-
end
|
4
|
-
|
5
|
-
When(/^I make a POST to "([^"]*)"$/) do |url|
|
6
|
-
Cucoo::Driver.post url
|
7
|
-
end
|
8
|
-
|
9
|
-
When(/^I make a POST to "([^"]*)" with headers "([^"]*)" and the following params:$/) do |url, headers, params|
|
10
|
-
header, value = headers.split(':')
|
11
|
-
Cucoo::Driver.post_with_header url, {header => value, 'Content-type' => 'text/plain; charset=UTF-8'}, params.hashes.first.to_json
|
12
|
-
end
|
13
|
-
|
14
|
-
When(/^I make a GET to "([^"]*)"$/) do |url|
|
15
|
-
Cucoo::Driver.get url
|
16
|
-
end
|
17
|
-
|
18
|
-
When(/^I make a DELETE to "([^"]*)"$/) do |url|
|
19
|
-
Cucoo::Driver.delete url
|
20
|
-
end
|
21
|
-
|
22
|
-
When(/^I make a DELETE to "([^"]*)" with:$/) do |url, params|
|
23
|
-
Cucoo::Driver.delete url, params.hashes.first
|
24
|
-
end
|
25
|
-
|
26
|
-
And(/^the response error message should be "([^"]*)"$/) do |message|
|
27
|
-
expect(Cucoo::Driver.response['error']).to eq(message)
|
28
|
-
end
|
29
|
-
|
30
|
-
And(/^the response body must be "([^"]*)"$/) do |body|
|
31
|
-
expect(Cucoo::Driver.response.to_s).to eq(body)
|
32
|
-
end
|
33
|
-
|
34
|
-
When(/^I send a PUT request to "([^"]*)" with:$/) do |url, params|
|
35
|
-
Cucoo::Driver.put url, params.hashes.first
|
36
|
-
end
|
37
|
-
|