Skip to content

Commit

Permalink
Add breaking scenario and spec for cucumber#520
Browse files Browse the repository at this point in the history
  • Loading branch information
mlex committed Aug 16, 2013
1 parent fa7c6c5 commit 4951753
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
26 changes: 25 additions & 1 deletion features/html_formatter.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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')
"""
4 changes: 3 additions & 1 deletion spec/cucumber/formatter/html_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 4951753

Please sign in to comment.