table tests: use empty string to mean no route

This commit is contained in:
Emil Tin
2015-01-03 11:12:27 +01:00
parent 24943ccee6
commit a0b55f9df3
2 changed files with 5 additions and 2 deletions
@@ -1,5 +1,6 @@
When /^I request a travel time matrix I should get$/ do |table|
no_route = 2147483647 # MAX_INT
raise "*** Top-left cell of matrix table must be empty" unless table.headers[0]==""
@@ -36,6 +37,8 @@ When /^I request a travel time matrix I should get$/ do |table|
0.upto(nodes.size-1) do |i|
if FuzzyMatch.match result[ri][i], row[i+1]
result[ri][i] = row[i+1]
elsif row[i+1]=="" and result[ri][i]==no_route
result[ri][i] = ""
else
result[ri][i] = result[ri][i].to_s
ok = false