Class: MissCleo::TestConfigurations::CucumberConfig
- Inherits:
-
Object
- Object
- MissCleo::TestConfigurations::CucumberConfig
- Defined in:
- lib/miss_cleo/test_configurations/cucumber_config.rb
Constant Summary collapse
- CUCUMBER_MAP =
"cucumber_map.json"- LOGS =
[]
Class Method Summary collapse
Class Method Details
.setup_hooks(context) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/miss_cleo/test_configurations/cucumber_config.rb', line 7 def self.setup_hooks(context) if ENV["COVERAGE"] Coverage.start context.Around do |scenario, execute| before = Coverage.peek_result execute.call after = Coverage.peek_result if file_and_line = scenario.try(:file_colon_line) LOGS << [ file_and_line, before, after ] end end at_exit do File.open(CUCUMBER_MAP, 'w') { |f| f.write JSON.dump LOGS } end end end |