diff --git a/features/html_formatter.feature b/features/html_formatter.feature
index 2f66bb6082..1adf7010b0 100644
--- a/features/html_formatter.feature
+++ b/features/html_formatter.feature
@@ -27,8 +27,22 @@ Feature: HTML output formatter
| two |
| three |
"""
+ And a file named "features/failing_background_step.feature" with:
+ """
+ Feature: Feature with failing background step
+
+ Background:
+ Given this fails
+
+ Scenario:
+ When I do something
+ Then I should see something
+ """
And a file named "features/step_definitions/steps.rb" with:
"""
+ Given /^this fails$/ do
+ fail 'This step should fail'
+ end
Given /^this hasn't been implemented yet$/ do
pending
end
@@ -61,10 +75,20 @@ Feature: HTML output formatter
"""
default: -r features
"""
- When I run `cucumber --profile default --format html`
+ When I run `cucumber features/scenario_outline_with_undefined_steps.feature --profile default --format html`
Then it should pass
And the output should not contain:
"""
Using the default profile...
"""
+ Scenario: a feature with a failing background step
+ When I run `cucumber features/failing_background_step.feature --format html`
+ Then the output should not contain:
+ """
+ makeRed('scenario_0')
+ """
+ And the output should contain:
+ """
+ makeRed('background_0')
+ """
diff --git a/spec/cucumber/formatter/html_spec.rb b/spec/cucumber/formatter/html_spec.rb
index 7c159e028c..ad97739a61 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
@@ -225,6 +225,8 @@ module Formatter
FEATURE
it { @doc.should have_css_node('.feature .background .step.failed', /eek/) }
+ it { @out.string.should_not include('makeRed(\'scenario_0\')') }
+ it { @out.string.should include('makeRed(\'background_0\')') }
it { @doc.should_not have_css_node('.feature .scenario .step.failed', //) }
it { @doc.should have_css_node('.feature .scenario .step.undefined', /yay/) }
end