Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Don't use 'else' keyword

  • Loading branch information...
commit 37084af9f971aaa25f0af5bd2e959f64fc5eb0d3 1 parent f2f1716
Oriol Gual oriolgual authored

Showing 1 changed file with 10 additions and 6 deletions. Show diff stats Hide diff stats

  1. +10 6 lib/spinach/runner/scenario_runner.rb
16 lib/spinach/runner/scenario_runner.rb
@@ -56,18 +56,22 @@ def run
56 56
57 57 def run_scenario_steps
58 58 steps.each do |step|
59   - Spinach.hooks.run_before_step step
60   - skip_or_run_step(step)
61   - Spinach.hooks.run_after_step step
  59 + run_step_with_hooks(step)
62 60 end
63 61 end
64 62
65   - def skip_or_run_step(step)
  63 + def run_step_with_hooks(step)
  64 + Spinach.hooks.run_before_step step
  65 + run_step(step) unless skip_step?(step)
  66 + Spinach.hooks.run_after_step step
  67 + end
  68 +
  69 + def skip_step?(step)
66 70 if @exception
67 71 Spinach.hooks.run_on_skipped_step step
68   - else
69   - run_step(step)
  72 + return true
70 73 end
  74 + return false
71 75 end
72 76
73 77 # Runs a particular step.

0 comments on commit 37084af

Please sign in to comment.
Something went wrong with that request. Please try again.