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

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

Defined Under Namespace

Modules: PrintsAfterHooks, TestCaseSource, TestStepSource Classes: AfterHookPrinter, BackgroundPrinter, Embedding, ExamplesArrayPrinter, ExamplesTablePrinter, ExpandTableRowPrinter, FeaturePrinter, FeaturesPrinter, HeaderTableRowPrinter, HiddenBackgroundPrinter, Indent, LegacyResultBuilder, OutlineStepsPrinter, ScenarioOutlinePrinter, ScenarioPrinter, StepsPrinter, TableRowPrinter, TableRowPrinterBase

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeAdapter

Returns a new instance of Adapter.


16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/cucumber/formatter/legacy_api/adapter.rb', line 16

def initialize(*)
  super
  emit_deprecation_warning

  @matches = collect_matches
  config.on_event(:test_case_started) do |event|
    formatter.before_test_case(event.test_case)
    printer.before_test_case(event.test_case)
  end
  config.on_event(:test_step_started) do |event|
    formatter.before_test_step(event.test_step)
    printer.before_test_step(event.test_step)
  end
  config.on_event(:test_step_finished) do |event|
    test_step, result = *event.attributes
    printer.after_test_step(test_step, result)
    formatter.after_test_step(test_step, result.with_filtered_backtrace(Cucumber::Formatter::BacktraceFilter))
  end
  config.on_event(:test_case_finished) do |event|
    test_case, result = *event.attributes
    record_test_case_result(test_case, result)
    printer.after_test_case(test_case, result)
    formatter.after_test_case(test_case, result.with_filtered_backtrace(Cucumber::Formatter::BacktraceFilter))
  end
  config.on_event(:test_run_finished) do
    printer.after
    formatter.done
  end
end

Instance Attribute Details

#configObject

Returns the value of attribute config

Returns:

  • (Object)

    the current value of config


13
14
15
# File 'lib/cucumber/formatter/legacy_api/adapter.rb', line 13

def config
  @config
end

#formatterObject

Returns the value of attribute formatter

Returns:

  • (Object)

    the current value of formatter


13
14
15
# File 'lib/cucumber/formatter/legacy_api/adapter.rb', line 13

def formatter
  @formatter
end

#resultsObject

Returns the value of attribute results

Returns:

  • (Object)

    the current value of results


13
14
15
# File 'lib/cucumber/formatter/legacy_api/adapter.rb', line 13

def results
  @results
end

Instance Method Details

#puts(*messages) ⇒ Object


49
50
51
# File 'lib/cucumber/formatter/legacy_api/adapter.rb', line 49

def puts(*messages)
  printer.puts(messages)
end