osrm-backend/features/step_definitions/options.rb

58 lines
1.4 KiB
Ruby
Raw Normal View History

2014-03-19 14:28:24 -04:00
When(/^I run "osrm\-routed\s?(.*?)"$/) do |options|
begin
2014-01-24 15:14:38 -05:00
Timeout.timeout(SHUTDOWN_TIMEOUT) { run_bin 'osrm-routed', options }
rescue Timeout::Error
raise "*** osrm-routed didn't quit. Maybe the --trial option wasn't used?"
2014-03-19 14:28:24 -04:00
end
end
When(/^I run "osrm\-extract\s?(.*?)"$/) do |options|
run_bin 'osrm-extract', options
end
When(/^I run "osrm\-prepare\s?(.*?)"$/) do |options|
run_bin 'osrm-prepare', options
end
2014-01-24 15:14:38 -05:00
When(/^I run "osrm\-datastore\s?(.*?)"$/) do |options|
run_bin 'osrm-datastore', options
end
2014-03-19 14:28:24 -04:00
Then /^it should exit with code (\d+)$/ do |code|
2014-06-30 14:43:51 -04:00
expect(@exit_code).to eq( code.to_i )
2014-03-19 14:28:24 -04:00
end
Then /^stdout should contain "(.*?)"$/ do |str|
2014-06-30 14:43:51 -04:00
expect(@stdout).to include(str)
2014-03-19 14:28:24 -04:00
end
Then /^stderr should contain "(.*?)"$/ do |str|
2014-06-30 14:43:51 -04:00
expect(@stderr).to include(str)
2014-03-22 06:36:42 -04:00
end
Then(/^stdout should contain \/(.*)\/$/) do |regex_str|
regex = Regexp.new regex_str
2014-06-30 14:43:51 -04:00
expect(@stdout).to match( regex )
2014-03-22 06:36:42 -04:00
end
Then(/^stderr should contain \/(.*)\/$/) do |regex_str|
regex = Regexp.new regex_str
2014-06-30 14:43:51 -04:00
expect(@stderr).to match( regex )
2014-03-19 14:28:24 -04:00
end
Then /^stdout should be empty$/ do
2014-06-30 14:43:51 -04:00
expect(@stdout).to eq("")
2014-03-19 14:28:24 -04:00
end
Then /^stderr should be empty$/ do
2014-06-30 14:43:51 -04:00
expect(@stderr).to eq("")
2014-03-19 14:28:24 -04:00
end
2014-03-22 06:36:42 -04:00
Then /^stdout should contain (\d+) lines?$/ do |lines|
2014-06-30 14:43:51 -04:00
expect(@stdout.lines.count).to eq( lines.to_i )
2014-03-22 06:36:42 -04:00
end
Given (/^the query options$/) do |table|
2015-12-08 17:00:11 -05:00
table.rows_hash.each { |k,v| @query_params << [k, v] }
end