moduleCucumberclassExecutorattr_reader:failedattr_accessor:formattersattr_writer:scenario_names,:lines_for_featuresdefinitialize(step_mother)@world_procs=[]@before_scenario_procs=[]@after_scenario_procs=[]@after_step_procs=[]@step_mother=step_mother@executed_scenarios={}@regular_scenario_cache={}enddefregister_world_proc(&proc)@world_procs<<procenddefregister_before_scenario_proc(&proc)proc.extend(CoreExt::CallIn)@before_scenario_procs<<procenddefregister_after_scenario_proc(&proc)proc.extend(CoreExt::CallIn)@after_scenario_procs<<procenddefregister_after_step_proc(&proc)proc.extend(CoreExt::CallIn)@after_step_procs<<procenddefvisit_features(features)formatters.visit_features(features)features.accept(self)formatters.dumpenddefvisit_feature(feature)@feature_file=feature.fileifaccept_feature?(feature)formatters.feature_executing(feature)feature.accept(self)@executed_scenarios={}@regular_scenario_cache={}endenddefvisit_header(header)formatters.header_executing(header)enddefvisit_row_scenario(scenario)execute_scenario(@regular_scenario_cache[scenario.name])ifexecuting_unprepared_row_scenario?(scenario)visit_scenario(scenario)enddefvisit_regular_scenario(scenario)@regular_scenario_cache[scenario.name]=scenariovisit_scenario(scenario)enddefvisit_scenario_outline(scenario)visit_regular_scenario(scenario)enddefvisit_scenario(scenario)ifaccept_scenario?(scenario)@executed_scenarios[scenario.name]=trueexecute_scenario(scenario)endenddefexecute_scenario(scenario)@error=nil@pending=nil@world=create_worldformatters.scenario_executing(scenario)@before_scenario_procs.each{|p|p.call_in(@world,*[])}scenario.accept(self)@after_scenario_procs.each{|p|p.call_in(@world,*[])}formatters.scenario_executed(scenario)enddefaccept_scenario?(scenario)scenario_at_specified_line?(scenario)&&scenario_has_specified_name?(scenario)enddefaccept_feature?(feature)feature.scenarios.any?{|s|accept_scenario?(s)}enddefvisit_row_step(step)visit_step(step)enddefvisit_regular_step(step)visit_step(step)enddefvisit_step_outline(step)regexp,args,proc=step.regexp_args_proc(@step_mother)formatters.step_traced(step,regexp,args)enddefvisit_step(step)unless@pending||@errorbeginregexp,args,proc=step.regexp_args_proc(@step_mother)formatters.step_executing(step,regexp,args)step.execute_in(@world,regexp,args,proc)@after_step_procs.each{|p|p.call_in(@world,*[])}formatters.step_passed(step,regexp,args)rescueForcedPending=>estep.error=erecord_pending_step(step,regexp,args)rescuePendingrecord_pending_step(step,regexp,args)rescue=>e@failed=true@error=step.error=eformatters.step_failed(step,regexp,args)endelsebeginregexp,args,proc=step.regexp_args_proc(@step_mother)step.execute_in(@world,regexp,args,proc)formatters.step_skipped(step,regexp,args)rescueForcedPending=>estep.error=erecord_pending_step(step,regexp,args)rescuePendingrecord_pending_step(step,regexp,args)rescueExceptionformatters.step_skipped(step,regexp,args)endendenddefrecord_pending_step(step,regexp,args)@pending=trueformatters.step_pending(step,regexp,args)enddefexecuting_unprepared_row_scenario?(scenario)accept_scenario?(scenario)&&!@executed_scenarios[scenario.name]enddefscenario_at_specified_line?(scenario)iflines_defined_for_current_feature?@lines_for_features[@feature_file].inject(false){|at_line,line|at_line||scenario.at_line?(line)}elsetrueendenddefscenario_has_specified_name?(scenario)if@scenario_names&&!@scenario_names.empty?@scenario_names.include?(scenario.name)elsetrueendenddeflines_defined_for_current_feature?@lines_for_features&&!@lines_for_features[@feature_file].nil?&&!@lines_for_features[@feature_file].empty?enddefcreate_worldworld=Object.new@world_procs.eachdo|world_proc|world=world_proc.call(world)endworld.extend(World::Pending)world.extend(::Spec::Matchers)ifdefined?(::Spec::Matchers)define_step_call_methods(world)worldenddefdefine_step_call_methods(world)world.instance_variable_set('@__executor',self)world.instance_evaldoclass<<selfdefrun_step(name)_,args,proc=@__executor.instance_variable_get(:@step_mother).regexp_args_proc(name)proc.call_in(self,*args)end%w{given when then and but}.eachdo|keyword|alias_methodCucumber.language[keyword],:run_stependendendendendend