Method: Cucumber::Formatter::Junit#initialize

Defined in:
lib/cucumber/formatter/junit.rb

#initialize(config) ⇒ Junit

Returns a new instance of Junit.

[View source] [View on GitHub]

22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/cucumber/formatter/junit.rb', line 22

def initialize(config)
  @ast_lookup = AstLookup.new(config)
  config.on_event :test_case_started, &method(:on_test_case_started)
  config.on_event :test_case_finished, &method(:on_test_case_finished)
  config.on_event :test_step_finished, &method(:on_test_step_finished)
  config.on_event :test_run_finished, &method(:on_test_run_finished)
  @reportdir = ensure_dir(config.out_stream, 'junit')
  @config = config
  @features_data = Hash.new do |h, k|
    h[k] = {
      feature: nil,
      failures: 0,
      errors: 0,
      tests: 0,
      skipped: 0,
      time: 0,
      builder: Builder::XmlMarkup.new(indent: 2)
    }
  end
end