Skip to content
Closed
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
1 change: 0 additions & 1 deletion features/docs/cli/strict_mode.feature
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ Feature: Strict mode
Given this step passes
"""

@wip-new-core
Scenario: Fail with --strict
When I run `cucumber -q features/missing.feature --strict`
Then it should fail with:
Expand Down
8 changes: 5 additions & 3 deletions lib/cucumber/reports/legacy_formatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,8 @@ def before
def step(step, result)
@child ||= StepsPrinter.new(formatter).before
@last_step_result = result
step_invocation = LegacyResultBuilder.new(result).step_invocation(step_match(step), step, indent, background = nil)
legacy_result_builder = LegacyResultBuilder.new(result)
step_invocation = legacy_result_builder.step_invocation(step_match(step, legacy_result_builder), step, indent, background = nil)
runtime.step_visited step_invocation
@child.step_invocation step_invocation, runtime
end
Expand All @@ -299,9 +300,10 @@ def last_step_result
@last_step_result || Core::Test::Result::Unknown.new
end

def step_match(step)
def step_match(step, legacy_result_builder)
runtime.step_match(step.name)
rescue Cucumber::Undefined
rescue Cucumber::Undefined => e
legacy_result_builder.exception(e) if runtime.strict?
NoStepMatch.new(step, step.name)
end

Expand Down
4 changes: 4 additions & 0 deletions lib/cucumber/runtime.rb
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,10 @@ def doc_string(string_without_triple_quotes, content_type='', line_offset=0)
Core::Ast::DocString.new(string_without_triple_quotes, content_type, location)
end

def strict?
@configuration.strict?
end

private

def fire_after_configuration_hook #:nodoc
Expand Down