cucoo 0.0.2 → 0.0.3

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: 66bad9fda5aed0527088b95c9908af54d44cf771
4
- data.tar.gz: ccb0bb323e5d3e1f1a8680d3bac96500790558e9
3
+ metadata.gz: b1e39585ef2d97c0a9beeabb30cea534c7e9c7ef
4
+ data.tar.gz: f29132292fc8b6df5235b02b8accc4d0505dccb9
5
5
  SHA512:
6
- metadata.gz: 6de3dd6e1cb365bbbf39301ca233fa29ef26ba63b75f3d26fd0a4c19559ef46210dab2f28d3e6cd9d84a02050080108a03865fcfe0e9c3e2c334f99a035adf76
7
- data.tar.gz: e31cdaace674706c95f2312c0be8c7b0ab1e73e69cd14e016ba1a56b92088520a24e3376067c489e408644da9df92d8bd6f51ab8a55773ea80a24f3bab770544
6
+ metadata.gz: 4b52dc53a5e0765f3d8fd12c71da2fdecfd9aa86a8dc44f4621dcedc738093c86d4b01187a76c5ee0b2c225aa717a90eb93712baddd8d575ab69085ac13a0ad5
7
+ data.tar.gz: 09084ed38a53025059c3c95be893d23d1a9e2faf0e42b2d245e24b9254d558750c8d553ff3bdbbff2f2424ef37c072dec64ef5a531e9b682cdc5b455e4264792
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)
@@ -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/step_definitions/api_steps'
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!
@@ -1,3 +1,3 @@
1
1
  module Cucoo
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
  end
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.2
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
-
@@ -1,3 +0,0 @@
1
- def last_json
2
- Cucoo::Driver.response.body
3
- end