upgrade to cucumber 2.0

This commit is contained in:
Emil Tin
2015-04-30 14:54:14 +02:00
parent 12e1bd80b3
commit 1ed2c16a51
8 changed files with 28 additions and 29 deletions
+1 -1
View File
@@ -52,5 +52,5 @@ When /^I request a travel time matrix I should get$/ do |table|
actual << r
end
end
table.routing_diff! actual
table.diff! actual
end
+1 -1
View File
@@ -39,7 +39,7 @@ When /^I request locate I should get$/ do |table|
actual << got
end
end
table.routing_diff! actual
table.diff! actual
end
When /^I request locate (\d+) times I should get$/ do |n,table|
+1 -1
View File
@@ -39,7 +39,7 @@ When /^I request nearest I should get$/ do |table|
actual << got
end
end
table.routing_diff! actual
table.diff! actual
end
When /^I request nearest (\d+) times I should get$/ do |n,table|
+1 -1
View File
@@ -74,5 +74,5 @@ Then /^routability should be$/ do |table|
actual << output_row
end
end
table.routing_diff! actual
table.diff! actual
end
+1 -1
View File
@@ -140,7 +140,7 @@ When /^I route I should get$/ do |table|
actual << got
end
end
table.routing_diff! actual
table.diff! actual
end
When /^I route (\d+) times I should get$/ do |n,table|
+2 -2
View File
@@ -1,8 +1,8 @@
#monkey patch cucumber table class to reorder output.
#we always want failed rows to be shown right below the expected row.
class Cucumber::Ast::Table
def routing_diff!(other_table, options={})
class Cucumber::MultilineArgument::DataTable
def diff!(other_table, options={})
options = {:missing_row => true, :surplus_row => true, :missing_col => true, :surplus_col => false}.merge(options)
other_table = ensure_table(other_table)
+5 -11
View File
@@ -4,22 +4,16 @@ STRESS_TIMEOUT = 300
Before do |scenario|
# feature name
# fetch scenario and feature name, so we can use it in log files if needed
case scenario
when Cucumber::Ast::Scenario
when Cucumber::RunningTestCase::Scenario
@feature_name = scenario.feature.name
when Cucumber::Ast::OutlineTable::ExampleRow
@feature_name = scenario.scenario_outline.feature.name
end
# scenario name
case scenario
when Cucumber::Ast::Scenario
@scenario_title = scenario.name
when Cucumber::Ast::OutlineTable::ExampleRow
when Cucumber::RunningTestCase::ExampleRow
@feature_name = scenario.scenario_outline.feature.name
@scenario_title = scenario.scenario_outline.name
end
@load_method = DEFAULT_LOAD_METHOD
@query_params = {}
@scenario_time = Time.now.strftime("%Y-%m-%dT%H:%m:%SZ")