Skip to content

Commit

Permalink
More readable code
Browse files Browse the repository at this point in the history
  • Loading branch information
aslakhellesoy committed Nov 18, 2008
1 parent 276665d commit 2c6582c
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions lib/cucumber/executor.rb
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 2c6582c

Please sign in to comment.