Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion features/docs/exception_in_after_step_hook.feature
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Feature: Exception in AfterStep Block
| does something naughty |
This step has been very very naughty (NaughtyStepException)
./features/support/env.rb:4:in `AfterStep'
features/naughty_step_in_scenario_outline.feature:4:in `Given this step does something naughty'
features/naughty_step_in_scenario_outline.feature:4:in `Given this step <Might Work>'
| passes |

Scenario: Success # features/naughty_step_in_scenario_outline.feature:12
Expand Down
2 changes: 1 addition & 1 deletion features/docs/gherkin/outlines.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@wip-new-core
@spawn
Feature: Scenario outlines

Expand Down Expand Up @@ -134,6 +133,7 @@ Feature: Scenario outlines

# There are 10 characters in the progress, but only 8 reported steps. Needs investigation.
# Looks like we're outputting too many characters.
@wip-new-core
Scenario: Run all with progress formatter
When I run `cucumber -q --format progress features/outline_sample.feature`
Then it should fail with:
Expand Down
5 changes: 1 addition & 4 deletions lib/cucumber/reports/legacy_formatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -778,9 +778,6 @@ def after
formatter.after_table_row(legacy_table_row)
@after_step_hook_result.describe_exception_to formatter if @after_step_hook_result
@after_hook_result.describe_exception_to(formatter) if @after_hook_result
if @failed_step
formatter.exception @failed_step.exception, @failed_step.status
end
@done = true
self
end
Expand Down Expand Up @@ -936,7 +933,7 @@ def filtered_step_exception(step)

class StepBacktraceLine < Struct.new(:step)
def to_s
"#{step.location}:in `#{step.keyword}#{step.name}'"
"#{step.location}:in `#{step.keyword}#{step.gherkin_statement.name}'"
end
end

Expand Down
52 changes: 52 additions & 0 deletions spec/cucumber/reports/legacy_formatter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,58 @@ module Cucumber
]
end

it 'failing scenario outline' do
execute_gherkin do
feature do
scenario_outline do
step '<result>ing'
examples do
row 'result'
row 'fail'
end
end
end
end
expect( formatter.messages ).to eq [
:before_features,
:before_feature,
:before_tags,
:after_tags,
:feature_name,
:before_feature_element,
:before_tags,
:after_tags,
:scenario_name,
:before_steps,
:before_step,
:before_step_result,
:step_name,
:after_step_result,
:after_step,
:after_steps,
:before_examples_array,
:before_examples,
:examples_name,
:before_outline_table,
:before_table_row,
:before_table_cell,
:table_cell_value,
:after_table_cell,
:after_table_row,
:before_table_row,
:before_table_cell,
:table_cell_value,
:after_table_cell,
:after_table_row,
:after_outline_table,
:after_examples,
:after_examples_array,
:after_feature_element,
:after_feature,
:after_features
]
end

context 'with exception in after step hook' do
it 'prints the exception within the step' do
define_steps do
Expand Down