more tests passing

This commit is contained in:
Emil Tin
2014-08-12 14:18:02 +02:00
parent a5ee7e78f6
commit 235a52032a
8 changed files with 125 additions and 72 deletions
+13 -13
View File
@@ -4,9 +4,9 @@ Feature: Bike - Accessability of different way types
Background:
Given the profile "bicycle"
Given the shortcuts
| key | value |
| bike | 49s ~20% |
| foot | 121s ~20% |
| key | value |
| bike | 15 km/h ~20% |
| foot | 5 km/h ~20% |
Scenario: Bike - Pushing bikes on pedestrian-only ways
Then routability should be
@@ -98,11 +98,11 @@ Feature: Bike - Accessability of different way types
| cd | primary | |
When I route I should get
| from | to | route | turns |
| a | d | ab,bc,cd | head,right,left,destination |
| d | a | cd,bc,ab | head,enter_contraflow,leave_contraflow,destination |
| c | a | bc,ab | head,leave_contraflow,destination |
| d | b | cd,bc | head,enter_contraflow,destination |
| from | to | route | turns |
| a | d | ab,bc,cd | head,right,left,destination |
| d | a | cd,bc,ab | head,right,left,destination |
| c | a | bc,ab | head,left,destination |
| d | b | cd,bc | head,right,destination |
@todo
Scenario: Bike - Instructions when pushing bike on footway/pedestrian, etc.
@@ -117,8 +117,8 @@ Feature: Bike - Accessability of different way types
| cd | primary |
When I route I should get
| from | to | route | turns |
| a | d | ab,bc,cd | head,right,left,destination |
| d | a | cd,bc,ab | head,enter_contraflow,leave_contraflow,destination |
| c | a | bc,ab | head,leave_contraflow,destination |
| d | b | cd,bc | head,enter_contraflow,destination |
| from | to | route | turns |
| a | d | ab,bc,cd | head,right,left,destination |
| d | a | cd,bc,ab | head,right,left,destination |
| c | a | bc,ab | head,left,destination |
| d | b | cd,bc | head,right,destination |
+3 -3
View File
@@ -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
+6 -6
View File
@@ -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
+15 -1
View File
@@ -157,7 +157,20 @@ Feature: Testbot - Mode flag
| a,0,d | ab,bc,cd | 1,3,1 |
| d,0,a | cd,bc,ab | 1,4,1 |
Scenario: Testbot - Modes when starting on opposite oneway
Scenario: Testbot - Modes when starting on forward oneway
Given the node map
| a | b |
And the ways
| nodes | highway | oneway |
| ab | river | yes |
When I route I should get
| from | to | route | modes |
| a | b | ab | 3 |
| b | a | | |
Scenario: Testbot - Modes when starting on reverse oneway
Given the node map
| a | b |
@@ -167,4 +180,5 @@ Feature: Testbot - Mode flag
When I route I should get
| from | to | route | modes |
| a | b | | |
| b | a | ab | 4 |