Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Don't use 'else' keyword

  • Loading branch information...
commit 37084af9f971aaa25f0af5bd2e959f64fc5eb0d3 1 parent f2f1716
Oriol Gual oriolgual authored
Showing with 10 additions and 6 deletions.
  1. +10 −6 lib/spinach/runner/scenario_runner.rb
16 lib/spinach/runner/scenario_runner.rb
View
@@ -56,18 +56,22 @@ def run
def run_scenario_steps
steps.each do |step|
- Spinach.hooks.run_before_step step
- skip_or_run_step(step)
- Spinach.hooks.run_after_step step
+ run_step_with_hooks(step)
end
end
- def skip_or_run_step(step)
+ def run_step_with_hooks(step)
+ Spinach.hooks.run_before_step step
+ run_step(step) unless skip_step?(step)
+ Spinach.hooks.run_after_step step
+ end
+
+ def skip_step?(step)
if @exception
Spinach.hooks.run_on_skipped_step step
- else
- run_step(step)
+ return true
end
+ return false
end
# Runs a particular step.
Please sign in to comment.
Something went wrong with that request. Please try again.