Class: Cucumber::Formatter::LegacyApi::Adapter::ScenarioPrinter

Inherits:
Struct
  • Object
show all
Includes:
PrintsAfterHooks
Defined in:
lib/cucumber/formatter/legacy_api/adapter.rb

Instance Method Summary collapse

Methods included from PrintsAfterHooks

#after_hook, #after_hook_results

Instance Method Details

#afterObject



543
544
545
546
547
548
549
550
551
# File 'lib/cucumber/formatter/legacy_api/adapter.rb', line 543

def after
  return if @done
  @child.after if @child
  scenario = LegacyResultBuilder.new(@test_case_result).scenario(node.name, node.location)
  after_hook_results.accept(formatter)
  formatter.after_feature_element(scenario)
  @done = true
  self
end

#after_step_hook(result) ⇒ Object



534
535
536
# File 'lib/cucumber/formatter/legacy_api/adapter.rb', line 534

def after_step_hook(result)
  result.accept formatter
end

#after_test_case(test_case, result) ⇒ Object



538
539
540
541
# File 'lib/cucumber/formatter/legacy_api/adapter.rb', line 538

def after_test_case(test_case, result)
  @test_case_result = result
  after
end

#beforeObject



520
521
522
523
524
525
526
527
# File 'lib/cucumber/formatter/legacy_api/adapter.rb', line 520

def before
  formatter.before_feature_element(node)
  Ast::Comments.new(node.comments).accept(formatter)
  Ast::Tags.new(node.tags).accept(formatter)
  formatter.scenario_name node.keyword, node.legacy_conflated_name_and_description, node.location.to_s, indent.of(node)
  before_hook_results.accept(formatter)
  self
end

#step_invocation(step_invocation, source) ⇒ Object



529
530
531
532
# File 'lib/cucumber/formatter/legacy_api/adapter.rb', line 529

def step_invocation(step_invocation, source)
  @child ||= StepsPrinter.new(formatter).before
  @child.step_invocation step_invocation
end