lib/cucumber/executor.rb in aslakhellesoy-cucumber-0.1.15 vs lib/cucumber/executor.rb in aslakhellesoy-cucumber-0.1.16
- old
+ new
@@ -1,10 +1,10 @@
module Cucumber
class Executor
attr_reader :failed
attr_accessor :formatters
- attr_writer :scenario_names, :lines_for_features
+ attr_writer :scenario_names, :lines_for_features, :dry_run
def initialize(step_mother)
@world_procs = []
@before_scenario_procs = []
@after_scenario_procs = []
@@ -81,13 +81,13 @@
@pending = nil
@world = create_world
formatters.scenario_executing(scenario)
- @before_scenario_procs.each{|p| p.call_in(@world, *[])}
+ @before_scenario_procs.each{|p| p.call_in(@world, *[])} unless @dry_run
scenario.accept(self)
- @after_scenario_procs.each{|p| p.call_in(@world, *[])}
+ @after_scenario_procs.each{|p| p.call_in(@world, *[])} unless @dry_run
formatters.scenario_executed(scenario)
end
def accept_scenario?(scenario)
scenario_at_specified_line?(scenario) &&
@@ -114,10 +114,10 @@
def visit_step(step)
unless @pending || @error
begin
regexp, args, proc = step.regexp_args_proc(@step_mother)
formatters.step_executing(step, regexp, args)
- step.execute_in(@world, regexp, args, proc)
+ step.execute_in(@world, regexp, args, proc) unless @dry_run
@after_step_procs.each{|p| p.call_in(@world, *[])}
formatters.step_passed(step, regexp, args)
rescue ForcedPending => e
step.error = e
record_pending_step(step, regexp, args)