more tests passing
This commit is contained in:
@@ -54,11 +54,11 @@ Then /^routability should be$/ do |table|
|
||||
want = shortcuts_hash[row[direction]] || row[direction] #expand shortcuts
|
||||
case want
|
||||
when '', 'x'
|
||||
output_row[direction] = result[direction][:status].to_s
|
||||
output_row[direction] = result[direction][:time] ? result[direction][:status].to_s : ''
|
||||
when /^\d+s/
|
||||
output_row[direction] = "#{result[direction][:time]}s"
|
||||
output_row[direction] = result[direction][:time] ? "#{result[direction][:time]}s" : ''
|
||||
when /^\d+ km\/h/
|
||||
output_row[direction] = "#{result[direction][:speed]} km/h"
|
||||
output_row[direction] = result[direction][:speed] ? "#{result[direction][:speed]} km/h" : ''
|
||||
else
|
||||
raise "*** Unknown expectation format: #{want}"
|
||||
end
|
||||
|
||||
@@ -104,22 +104,22 @@ When /^I route I should get$/ do |table|
|
||||
end
|
||||
end
|
||||
if table.headers.include? 'bearing'
|
||||
got['bearing'] = bearings
|
||||
got['bearing'] = instructions ? bearings : ''
|
||||
end
|
||||
if table.headers.include? 'compass'
|
||||
got['compass'] = compasses
|
||||
got['compass'] = instructions ? compasses : ''
|
||||
end
|
||||
if table.headers.include? 'turns'
|
||||
got['turns'] = turns
|
||||
got['turns'] = instructions ? turns : ''
|
||||
end
|
||||
if table.headers.include? 'modes'
|
||||
got['modes'] = modes
|
||||
got['modes'] = instructions ? modes : ''
|
||||
end
|
||||
if table.headers.include? 'times'
|
||||
got['times'] = times
|
||||
got['times'] = instructions ? times : ''
|
||||
end
|
||||
if table.headers.include? 'distances'
|
||||
got['distances'] = distances
|
||||
got['distances'] = instructions ? distances : ''
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user