cucoo 0.0.5 → 0.0.6

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: dd367821dd7d496e5d4891486993ff938ef4f3bc
4
- data.tar.gz: 0e6fdf34f30b2e653e9e15c384dbdc046a2d2dc2
3
+ metadata.gz: cfb4667f509752bb120b6e7bdff086d00e82340b
4
+ data.tar.gz: f14338ffc157bf8dbf5ba09719fa99c0ef46ab9c
5
5
  SHA512:
6
- metadata.gz: a82f5e693d0908bd20f1d8366bcbefeca53b85dbaeffd24fbf7905adee612ba14973488f3b2d5b9bc455b770a491414c27341feb24588e902861dcb362ab6237
7
- data.tar.gz: 274c8ad13dbea45aacffe5ce1fa81aeb82257b0d63eafdf628d32ecdcd24fda5beef95e595fc856cf89da44b6986572289d1bc70f11da82f261622ac721ba3a6
6
+ metadata.gz: 55b7d1a3b5d035ec3b9fa3dd73479983e234572757b22eea5970426a46639bf048a5e0e7c9015be655d02424d7e0db47384335683bef30d78d61e0e0f2654f15
7
+ data.tar.gz: 55a355192882fb7e0749724a8c5c3df713e3ea2bf6593e70c15c1d3219d41be192b951e2afef01024e9ac630a17dd1d9ddc5e8a83f75b920cea052a359f34a31
@@ -4,86 +4,90 @@ def last_json
4
4
  end
5
5
 
6
6
  #API Steps
7
- When(/^I make a POST to "([^"]*)" with:$/) do |url, params|
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(/^I make a POST to "([^"]*)"$/) do |url|
11
+ When /^I make a POST to "([^"]*)"$/ do |url|
12
12
  Cucoo::Driver.post url
13
13
  end
14
14
 
15
- When(/^I make a POST to "([^"]*)" with headers "([^"]*)" and the following params:$/) do |url, headers, params|
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(/^I make a GET to "([^"]*)"$/) do |url|
20
+ When /^I make a GET to "([^"]*)"$/ do |url|
21
21
  Cucoo::Driver.get url
22
22
  end
23
23
 
24
- When(/^I make a DELETE to "([^"]*)"$/) do |url|
24
+ When /^I make a DELETE to "([^"]*)"$/ do |url|
25
25
  Cucoo::Driver.delete url
26
26
  end
27
27
 
28
- When(/^I make a DELETE to "([^"]*)" with:$/) do |url, params|
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(/^the response error message should be "([^"]*)"$/) do |message|
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(/^the response body must be "([^"]*)"$/) do |body|
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(/^I send a PUT request to "([^"]*)" with:$/) do |url, params|
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(/^I expect a POST to "([^"]*)" with:$/) do |url, table|
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(/^I expect a POST to "([^"]*)" with json request:$/) do |url, json|
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(/^I expect a PUT to "([^"]*)" with json request:$/) do |url, json|
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(/^I expect a GET to "([^"]*)" with:$/) do |url, table|
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
- Given(/^I expect a GET to "([^"]*)" and return NOT FOUND$/) do |url|
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(/^I expect a DELETE to "([^"]*)"$/) do |url|
71
+ And /^I expect a DELETE to "([^"]*)"$/ do |url|
68
72
  stub_my_request(:delete, url, {})
69
73
  end
70
74
 
71
- Then(/^the response should be OK$/) do
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(/^the response should be NOT FOUND$/) do
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(/^the response should be BAD REQUEST$/) do
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(/^the response code should be "([^"]*)"$/) do |code|
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
@@ -1,3 +1,3 @@
1
1
  module Cucoo
2
- VERSION = '0.0.5'
2
+ VERSION = '0.0.6'
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.5
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
File without changes