Step Definitions & Transforms
20 21 22 |
Given(/^I am a rest client$/) do @restbaby = Client.new("#{@protocol}://#{@server}:#{@port}#{@path}") end |
And
I am a rest client
features/headers/header_options.feature:8
features/headers/header_options.feature:20
features/headers/header_options.feature:34
features/headers/header_options.feature:43
features/print_response.feature:10
features/print_response.feature:29
features/print_response.feature:49
features/print_response.feature:69
features/rest_client.feature:7
features/rest_client.feature:15
features/rest_client.feature:26
features/rest_client.feature:37
46 47 48 49 |
Then(/^I receive the expected message$/) do expect(@response.code).to eq('200') expect(@response.body).to eq(DEFAULT_MESSAGE) end |
Then
I receive the expected message
features/headers/header_options.feature:12
features/headers/header_options.feature:28
features/headers/header_options.feature:37
features/headers/header_options.feature:46
features/print_response.feature:13
features/print_response.feature:34
features/print_response.feature:54
features/print_response.feature:71
features/rest_client.feature:9
features/rest_client.feature:20
features/rest_client.feature:31
features/rest_client.feature:39
3 4 5 6 7 8 |
Given(/^I have a web service$/) do @protocol = 'http' @server = FigNewton.server @port = FigNewton.port @mockservice = MockRestService.new(@server, @port, @protocol) end |
Given
I have a web service
features/headers/header_options.feature:5
features/headers/header_options.feature:16
features/headers/header_options.feature:32
features/print_response.feature:5
features/print_response.feature:24
features/print_response.feature:44
features/print_response.feature:64
features/rest_client.feature:5
features/rest_client.feature:13
features/rest_client.feature:24
features/rest_client.feature:35
24 25 26 27 28 29 30 31 |
When(/^I "(GET|DELETE)" from the web service$/) do |type| case type.downcase when 'get' @response = @restbaby.get(@path) when 'delete' @response = @restbaby.delete(@path) end end |
And
I "GET" from the web service
features/headers/header_options.feature:11
features/headers/header_options.feature:36
features/headers/header_options.feature:45
features/print_response.feature:12
features/rest_client.feature:8
When
I "DELETE" from the web service
features/print_response.feature:70
features/rest_client.feature:38
10 11 12 13 |
Given(/^I have "(GET|PUT|POST|DELETE)" service for "(.*?)"$/) do |type, path| @path = path @mockservice.store_msg(type, path, DEFAULT_MESSAGE) end |
And
I have "GET" service for "/test"
features/headers/header_options.feature:33
features/headers/header_options.feature:42
features/rest_client.feature:6
And
I have "PUT" service for "/test"
features/rest_client.feature:14
And
I have "POST" service for "/test"
features/rest_client.feature:25
And
I have "DELETE" service for "/test"
features/rest_client.feature:36
33 34 35 36 37 38 39 40 |
When(/^I "(PUT|POST)" to the web service with the following$/) do |type, | case type.downcase when 'put' @response = @restbaby.put(@path, ) when 'post' @response = @restbaby.post(@path, ) end end |
And
I "POST" to the web service with the following
features/headers/header_options.feature:24
features/print_response.feature:50
features/rest_client.feature:27
When
I "PUT" to the web service with the following
features/print_response.feature:30
features/rest_client.feature:16
15 16 17 18 |
Given(/^I have "(GET|PUT|POST|DELETE)" service for "(.*?)" as follows$/) do |type, path, | @path = path @mockservice.store_msg(type, path, ) end |
And
I have "GET" service for "/test" as follows
features/print_response.feature:6
And
I have "PUT" service for "/test" as follows
features/print_response.feature:25
And
I have "POST" service for "/test" as follows
features/print_response.feature:45
And
I have "DELETE" service for "/test" as follows
features/print_response.feature:65
56 57 58 |
Then(/^the response prints like the following$/) do |response| expect(@restbaby.print_last_response).to eq(response) end |
And
the response prints like the following
features/print_response.feature:14
features/print_response.feature:35
features/print_response.feature:55
features/print_response.feature:72
17 18 19 |
Given(/^I have basic auth for user "(.*?)" and password "(.*?)"$/) do |user, password| @restbaby.set_auth(user, password) end |
And
I have basic auth for user "test" and password "rest"
features/headers/header_options.feature:35
features/headers/header_options.feature:44
13 14 15 |
When(/^I have the following headers?$/) do |table| @restbaby.set_headers(table.rows_hash) end |
When
I have the following header
features/headers/header_options.feature:9
features/headers/header_options.feature:21
8 9 10 11 |
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_MESSAGE, table.rows_hash) end |
And
I have "GET" service for "/test" with the following headers
features/headers/header_options.feature:6
And
I have "POST" service for "/test" with the following headers
features/headers/header_options.feature:17
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/headers/header_options.feature:41
51 52 53 54 |
Then(/^I receive the following$/) do || expect(@response.code).to eq('200') expect(@response.body).to eq() end |
No steps were found to match this step definition.
No undefined steps