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, CoverageFilter.filter_and_trim(before), CoverageFilter.filter_and_trim(after) ]
end
end
at_exit do
File.open(CUCUMBER_MAP, 'w') { |f| f.write JSON.dump LOGS }
end
end
end
|