Step Definitions & Transforms
[Collapse All]
Step Definitions
Given /^I am a rest client$/
Rubular
Then /^I receive the expected message$/
Rubular
Given /^I have a web service$/
Rubular
features/step_definitions/rest_client_steps.rb:4
4
5
6
7
8
9
Given(/^I have a web service$/) do
  @protocol = 'http'
  @server = FigNewton.server
  @port = FigNewton.port
  @mockservice = MockRestService.new(@server, @port, @protocol)
end
When /^I "(GET|DELETE)" from the web service$/
Rubular
features/step_definitions/rest_client_steps.rb:45
45
46
47
48
49
50
51
52
When(/^I "(GET|DELETE)" from the web service$/) do |type|
  case type.downcase
  when 'get'
    @response = @restbaby.get
  when 'delete'
    @response = @restbaby.delete
  end
end
When /^I "(PUT|POST)" to the web service with the following$/
Rubular
features/step_definitions/rest_client_steps.rb:54
54
55
56
57
58
59
60
61
62
63
When(/^I "(PUT|POST)" to the web service with the following$/) \
do |type, message|
  @message = message.strip
  case type.downcase
  when 'put'
    @response = @restbaby.put(@message)
  when 'post'
    @response = @restbaby.post(@message)
  end
end
Given /^I have "(GET|PUT|POST|DELETE)" service for "([^"]*)"$/
Rubular
features/step_definitions/rest_client_steps.rb:11
11
12
13
14
15
16
17
18
19
20
Given(/^I have "(GET|PUT|POST|DELETE)" service for "([^"]*)"$/) do |type, path|
  @path = path
  if type == 'GET'
    create_get(path)
  else
    @path = path
    @mockservice.store_msg(type, path, DEFAULT_MSG,
                           {}, nil, nil, DEFAULT_RESPONSE)
  end
end
And I have "GET" service for "/test"
features/rest_client.feature:7
And I have "PUT" service for "/test"
features/rest_client.feature:16
And I have "POST" service for "/test"
features/rest_client.feature:28
And I have "DELETE" service for "/test"
features/rest_client.feature:40
And I have "GET" service for "/test?first=1&second=2&third=3"
features/url_parameter.feature:7
Given /^I have "(GET|PUT|POST|DELETE)" service for "([^"]*)" as follows$/
Rubular
features/step_definitions/rest_client_steps.rb:22
22
23
24
25
26
27
28
29
30
Given(/^I have "(GET|PUT|POST|DELETE)" service for "([^"]*)" as follows$/) \
do |type, path, message|
  @path = path
  if type == 'GET'
    create_get(path, message)
  else
    @mockservice.store_msg(type, path, DEFAULT_MSG, {}, nil, nil, message)
  end
end
And I have "GET" service for "/test" as follows
features/print_response.feature:7
And I have "PUT" service for "/test" as follows
features/print_response.feature:19
And I have "POST" service for "/test" as follows
features/print_response.feature:34
And I have "DELETE" service for "/test" as follows
features/print_response.feature:49
When /^I have the following headers?$/
Rubular
features/step_definitions/header_steps.rb:27
27
28
29
When(/^I have the following headers?$/) do |table|
  @restbaby.add_headers(table.rows_hash)
end
Given /^I have a secure web service$/
Rubular
features/step_definitions/header_steps.rb:1
1
2
3
4
5
6
Given(/^I have a secure web service$/) do
  @protocol = 'https'
  @server = FigNewton.server
  @port = FigNewton.port
  @mockservice = MockRestService.new(@server, @port, @protocol)
end
Given I have a secure web service
features/header_options.feature:46
Then /^I receive a message with "([^"]*)"$/
Rubular
features/step_definitions/rest_client_steps.rb:78
78
79
80
81
Then(/^I receive a message with "([^"]*)"$/) do |message|
  expect(@response.code).to eq('200')
  expect(@response.body).to eq(message)
end
Then I receive a message with "first=1&second=2&third=3"
features/url_parameter.feature:13
When /^I "GET" from the web service with the parameters$/
Rubular
features/step_definitions/rest_client_steps.rb:65
65
66
67
When(/^I "GET" from the web service with the parameters$/) do |table|
  @response = @restbaby.get({}, nil, table.rows_hash)
end
When I "GET" from the web service with the parameters
features/url_parameter.feature:9
Given /^I have "(GET|DELETE)" service for "([^"]*)" for \ user "([^"]*)" and password "([^"]*)"$/
Rubular | UNUSED
features/step_definitions/header_steps.rb:14
14
15
16
17
18
Given(/^I have "(GET|DELETE)" service for "([^"]*)" for \
user "([^"]*)" and password "([^"]*)"$/) do |type, path, user, password|
  @path = path
  @mockservice.store_msg(type, path, DEFAULT_MSG, {}, user, password)
end
No steps were found to match this step definition.
Given /^I have "(PUT|POST)" service for "([^"]*)" for \ user "([^"]*)" and password "([^"]*)"$/
Rubular | UNUSED
features/step_definitions/header_steps.rb:20
20
21
22
23
24
25
Given(/^I have "(PUT|POST)" service for "([^"]*)" for \
user "([^"]*)" and password "([^"]*)"$/) do |type, path, user, password, table|
  @path = path
  @headers = table.rows_hash
  @mockservice.store_msg(type, path, DEFAULT_MSG, @headers, user, password)
end
No steps were found to match this step definition.
When /^I pause$/
Rubular | UNUSED
features/step_definitions/rest_client_steps.rb:69
69
70
71
When(/^I pause$/) do
  pause
end
No steps were found to match this step definition.
Given /^I have "(GET|PUT|POST|DELETE)" service for "([^"]*)" \ with the following headers$/
Rubular | UNUSED
features/step_definitions/header_steps.rb:8
8
9
10
11
12
Given(/^I have "(GET|PUT|POST|DELETE)" service for "([^"]*)" \
with the following headers$/) do |type, path, table|
  @path = path
  @mockservice.store_msg(type, path, DEFAULT_MSG, table.rows_hash, nil, nil, DEFAULT_RESPONSE)
end
No steps were found to match this step definition.
Given /^I have basic auth for user "([^"]*)" \ and password "(.*?)"$/
Rubular | UNUSED
features/step_definitions/header_steps.rb:31
31
32
33
34
Given(/^I have basic auth for user "([^"]*)" \
and password "(.*?)"$/) do |user, password|
  @restbaby.set_auth(user, password)
end
No steps were found to match this step definition.
[Collapse All]
Step Transforms
Undefined Steps
And I have "GET" service for "/test" for user "test" and password "rest"
features/header_options.feature:37 features/header_options.feature:47
And I have "POST" service for "/test" with the following headers
features/header_options.feature:19
And I have "GET" service for "/test" with the following headers
features/header_options.feature:7