Class: Cucumber::Formatter::LegacyApi::Adapter::BackgroundPrinter

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

Instance Method Summary collapse

Instance Method Details

#afterObject



478
479
480
481
482
# File 'lib/cucumber/formatter/legacy_api/adapter.rb', line 478

def after
  @child.after if @child
  formatter.after_background(Ast::Background.new(feature, node))
  self
end

#after_hookObject



455
456
# File 'lib/cucumber/formatter/legacy_api/adapter.rb', line 455

def after_hook(*)
end

#after_step_hook(result) ⇒ Object



466
467
468
# File 'lib/cucumber/formatter/legacy_api/adapter.rb', line 466

def after_step_hook(result)
  result.accept formatter
end

#after_test_caseObject



452
453
# File 'lib/cucumber/formatter/legacy_api/adapter.rb', line 452

def after_test_case(*)
end

#beforeObject



458
459
460
461
462
463
464
# File 'lib/cucumber/formatter/legacy_api/adapter.rb', line 458

def before
  formatter.before_background Ast::Background.new(feature, node)
  Ast::Comments.new(node.comments).accept(formatter)
  formatter.background_name node.keyword, node.legacy_conflated_name_and_description, node.location.to_s, indent.of(node)
  before_hook_results.accept(formatter)
  self
end

#failed?Boolean

Returns:

  • (Boolean)


484
485
486
# File 'lib/cucumber/formatter/legacy_api/adapter.rb', line 484

def failed?
  @failed
end

#step_invocation(step_invocation, source) ⇒ Object



470
471
472
473
474
475
476
# File 'lib/cucumber/formatter/legacy_api/adapter.rb', line 470

def step_invocation(step_invocation, source)
  @child ||= StepsPrinter.new(formatter).before
  @child.step_invocation step_invocation
  if source.step_result.status == :failed
    @failed = true
  end
end