Permalink
Browse files

More readable code

  • Loading branch information...
1 parent 276665d commit 2c6582c204349117b490e6261b9fcd2f80b82728 @aslakhellesoy aslakhellesoy committed Nov 18, 2008
Showing with 11 additions and 5 deletions.
  1. +11 −5 lib/cucumber/executor.rb
View
@@ -97,11 +97,9 @@ def execute_scenario(scenario)
end
def accept_scenario?(scenario)
- accept = true
- accept &&= scenario_at_specified_line?(scenario)
- accept &&= scenario.at_line?(@line) if @line
- accept &&= scenario_has_specified_name?(scenario)
- accept
+ scenario_at_specified_line?(scenario) &&
+ scenario_at_specified_line_old?(scenario) &&
+ scenario_has_specified_name?(scenario)
end
def accept_feature?(feature)
@@ -177,6 +175,14 @@ def scenario_at_specified_line?(scenario)
end
end
+ def scenario_at_specified_line_old?(scenario)
+ if @line
+ scenario.at_line?(@line)
+ else
+ true
+ end
+ end
+
def scenario_has_specified_name?(scenario)
if @scenario_names && !@scenario_names.empty?
@scenario_names.include?(scenario.name)

0 comments on commit 2c6582c

Please sign in to comment.