allow setting origin in cuke tests
This commit is contained in:
@@ -6,6 +6,10 @@ Given /^a grid size of (\d+) meters$/ do |meters|
|
||||
set_grid_size meters
|
||||
end
|
||||
|
||||
Given /^the origin lat\/lon (\d+),(\d+)$/ do |lat,lon|
|
||||
set_origin [lon.to_f,lat.to_f]
|
||||
end
|
||||
|
||||
Given /^the shortcuts$/ do |table|
|
||||
table.hashes.each do |row|
|
||||
shortcuts_hash[ row['key'] ] = row['value']
|
||||
|
||||
@@ -12,12 +12,12 @@ Then /^routability should be$/ do |table|
|
||||
['forw','backw','bothw'].each do |direction|
|
||||
if table.headers.include? direction
|
||||
if direction == 'forw' || direction == 'bothw'
|
||||
a = Location.new ORIGIN[0]+(1+WAY_SPACING*i)*@zoom, ORIGIN[1]
|
||||
b = Location.new ORIGIN[0]+(3+WAY_SPACING*i)*@zoom, ORIGIN[1]
|
||||
a = Location.new @origin[0]+(1+WAY_SPACING*i)*@zoom, @origin[1]
|
||||
b = Location.new @origin[0]+(3+WAY_SPACING*i)*@zoom, @origin[1]
|
||||
response = request_route [a,b]
|
||||
elsif direction == 'backw' || direction == 'bothw'
|
||||
a = Location.new ORIGIN[0]+(3+WAY_SPACING*i)*@zoom, ORIGIN[1]
|
||||
b = Location.new ORIGIN[0]+(1+WAY_SPACING*i)*@zoom, ORIGIN[1]
|
||||
a = Location.new @origin[0]+(3+WAY_SPACING*i)*@zoom, @origin[1]
|
||||
b = Location.new @origin[0]+(1+WAY_SPACING*i)*@zoom, @origin[1]
|
||||
response = request_route [a,b]
|
||||
end
|
||||
want = shortcuts_hash[row[direction]] || row[direction] #expand shortcuts
|
||||
|
||||
Reference in New Issue
Block a user