osrm-backend/features/support/request.rb

15 lines
309 B
Ruby
Raw Normal View History

2012-12-10 10:07:47 -05:00
require 'net/http'
HOST = 'http://localhost:5000'
def request_path path
@query = path
log path
uri = URI.parse "#{HOST}/#{path}"
Net::HTTP.get_response uri
rescue Errno::ECONNREFUSED => e
raise "*** osrm-routed is not running."
rescue Timeout::Error
raise "*** osrm-routed did not respond."
end