lib/cucumber/ast/background.rb in aslakhellesoy-cucumber-0.2.3.4 vs lib/cucumber/ast/background.rb in aslakhellesoy-cucumber-0.3.0

- old
+ new

@@ -22,12 +22,22 @@ end def accept(visitor) visitor.visit_comment(@comment) visitor.visit_background_name(@keyword, @name, file_colon_line(@line), source_indent(text_length)) - visitor.step_mother.before_and_after(self) + visitor.step_mother.before(self) visitor.visit_steps(@step_invocations) @failed = @step_invocations.detect{|step_invocation| step_invocation.exception} + visitor.step_mother.after(self) if @failed + end + + def accept_hook?(hook) + # TODO: When background is involved - no tag based hook filtering is occurring with + # the current implementation. All hooks will be executed. This is because of the line + # visitor.step_mother.before(self) + # in the #accept method above. Instead, we should really be passing the first scenario + # here. We currently don't have access to that, so a refactoring is in order to make that happen. + true end def failed? @failed end \ No newline at end of file