Class: ElasticResults::Cucumber::JSONFormatter

Inherits:
Gherkin::Formatter::JSONFormatter
  • Object
show all
Defined in:
lib/elastic_results/cucumber.rb

Overview

Replacement for the stock Json formatter that outputs to elasticsearch

Instance Method Summary collapse

Constructor Details

#initializeJSONFormatter

Returns a new instance of JSONFormatter.



14
15
16
17
# File 'lib/elastic_results/cucumber.rb', line 14

def initialize
  @feature_hashes = []
  @current_step_or_hook = nil
end

Instance Method Details

#doneObject



26
27
28
# File 'lib/elastic_results/cucumber.rb', line 26

def done
  ElasticResults.write_urls
end

#eofObject



19
20
21
22
23
24
# File 'lib/elastic_results/cucumber.rb', line 19

def eof
  feature_hash = @feature_hashes.last
  feature_hash['elements'].each do |scenario_hash|
    record_scenario feature_hash, scenario_hash
  end
end