fix problem with meters and empty cells in tests
This commit is contained in:
parent
7610af3378
commit
263409ed91
@ -216,11 +216,13 @@ When /^I route I should get$/ do |table|
|
||||
end
|
||||
if table.headers.include? 'route'
|
||||
got['route'] = (instructions || '').strip
|
||||
if table.headers.include? 'distance'
|
||||
raise "*** Distance must be specied in meters. (ex: 250m)" unless row['distance'] =~ /\d+m/
|
||||
if table.headers.include?('distance')
|
||||
if row['distance']!=''
|
||||
raise "*** Distance must be specied in meters. (ex: 250m)" unless row['distance'] =~ /\d+m/
|
||||
end
|
||||
got['distance'] = instructions ? json['route_summary']['total_distance'].to_s : ''
|
||||
end
|
||||
if table.headers.include? 'time'
|
||||
if table.headers.include?('time')
|
||||
raise "*** Time must be specied in seconds. (ex: 60s)" unless row['time'] =~ /\d+s/
|
||||
got['time'] = instructions ? "#{json['route_summary']['total_time'].to_s}s" : ''
|
||||
end
|
||||
|
@ -17,9 +17,9 @@ Feature: Routing close to the [0,0] origin
|
||||
| abcd | yes |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | distance |
|
||||
| b | c | abcd | 100 +-1 |
|
||||
| c | b | | |
|
||||
| from | to | route | distance |
|
||||
| b | c | abcd | 100m +-1 |
|
||||
| c | b | | |
|
||||
|
||||
Scenario: North-south oneways close to the origin
|
||||
Given the node locations
|
||||
@ -34,9 +34,9 @@ Feature: Routing close to the [0,0] origin
|
||||
| abcd | yes |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | distance |
|
||||
| b | c | abcd | 100 +-1 |
|
||||
| c | b | | |
|
||||
| from | to | route | distance |
|
||||
| b | c | abcd | 100m +-1 |
|
||||
| c | b | | |
|
||||
|
||||
Scenario: East-west oneways crossing the origin
|
||||
Given the node locations
|
||||
@ -52,9 +52,9 @@ Feature: Routing close to the [0,0] origin
|
||||
| abcde | yes |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | distance |
|
||||
| b | d | abcde | 200 +-1 |
|
||||
| d | b | | |
|
||||
| from | to | route | distance |
|
||||
| b | d | abcde | 200m +-1 |
|
||||
| d | b | | |
|
||||
|
||||
Scenario: North-south oneways crossing the origin
|
||||
Given the node locations
|
||||
@ -70,6 +70,6 @@ Feature: Routing close to the [0,0] origin
|
||||
| abcde | yes |
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | distance |
|
||||
| b | d | abcde | 200 +-1 |
|
||||
| d | b | | |
|
||||
| from | to | route | distance |
|
||||
| b | d | abcde | 200m +-1 |
|
||||
| d | b | | |
|
||||
|
Loading…
Reference in New Issue
Block a user