7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# File 'lib/miss_cleo/test_configurations/rspec_config.rb', line 7
def self.setup_hooks(context)
if ENV["COVERAGE"]
Coverage.start
RSpec.configuration.after(:suite) do
File.open(RSPEC_MAP, 'w') { |f| f.write JSON.dump LOGS }
end
RSpec.configuration.around(:example) do |example|
before = Coverage.peek_result
example.call
after = Coverage.peek_result
LOGS << [ example.location, CoverageFilter.filter_core(before),
CoverageFilter.filter_core(after) ]
end
end
end
|