From 3cc8b754b99d4974d0c49177f19f55a21f7a5eeb Mon Sep 17 00:00:00 2001 From: Michael Lex Date: Fri, 16 Aug 2013 10:18:38 +0200 Subject: [PATCH] Fixed #522: Do not print superfluous and badly formatted backtrace when failing step is a background step --- lib/cucumber/formatter/html.rb | 1 + spec/cucumber/formatter/html_spec.rb | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/cucumber/formatter/html.rb b/lib/cucumber/formatter/html.rb index 5d60e032b0..f31753f4ff 100644 --- a/lib/cucumber/formatter/html.rb +++ b/lib/cucumber/formatter/html.rb @@ -268,6 +268,7 @@ def step_name(keyword, step_match, status, source_indent, background, file_colon end def exception(exception, status) + return if @hide_this_step build_exception_detail(exception) end diff --git a/spec/cucumber/formatter/html_spec.rb b/spec/cucumber/formatter/html_spec.rb index 7c159e028c..b99c8d5c0b 100644 --- a/spec/cucumber/formatter/html_spec.rb +++ b/spec/cucumber/formatter/html_spec.rb @@ -211,7 +211,7 @@ module Formatter it { @doc.should have_css_node('.feature .scenario .step.failed .message', /StandardError/) } end - describe "with a step that fails in the backgound" do + describe "with a step that fails in the background" do define_steps do Given(/boo/) { raise 'eek' } end @@ -227,6 +227,8 @@ module Formatter it { @doc.should have_css_node('.feature .background .step.failed', /eek/) } it { @doc.should_not have_css_node('.feature .scenario .step.failed', //) } it { @doc.should have_css_node('.feature .scenario .step.undefined', /yay/) } + it { @doc.should have_css_node('.feature .background .backtrace', //) } + it { @doc.should_not have_css_node('.feature .scenario .backtrace', //) } end describe "with a step that embeds a snapshot" do