lib/lucid/ast/background.rb in lucid-0.0.9 vs lib/lucid/ast/background.rb in lucid-0.1.0

- old
+ new

@@ -24,21 +24,21 @@ def step_invocations @step_invocations ||= steps.step_invocations(true) end - def step_collection(scenario_step_invocations) + def create_step_invocations(scenario_step_invocations) if(@first_collection_created) steps.step_invocations(true).dup(scenario_step_invocations) else @first_collection_created = true step_invocations.dup(scenario_step_invocations) end end def accept(visitor) - return if Lucid.wants_to_quit + return if @already_visited visitor.visit_background(self) do comment.accept(visitor) visitor.visit_background_name(@keyword, name, file_colon_line, source_indent(first_line_length)) with_visitor(hook_context, visitor) do visitor.runtime.before(hook_context) @@ -46,9 +46,10 @@ step_invocations.accept(visitor) @failed = step_invocations.any? { |step_invocation| step_invocation.exception || step_invocation.status != :passed } visitor.runtime.after(hook_context) if @failed || feature_elements.empty? end end + @already_visited = true end def with_visitor(scenario, visitor) @current_visitor = visitor if self != scenario && scenario.respond_to?(:with_visitor)