34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
# File 'lib/rspec/support/spec.rb', line 34
def self.setup_simplecov(&block)
old_verbose, $VERBOSE = $VERBOSE, false
return if ENV['NO_COVERAGE'] || RUBY_VERSION < '1.9.3' || RUBY_ENGINE != 'ruby'
return if RSpec.configuration.files_to_run.one?
require 'simplecov'
SimpleCov.start do
add_filter "./bundle/"
add_filter "./tmp/"
add_filter do |source_file|
source_file.filename.include?('/spec/') && !source_file.filename.include?('/lib/')
end
instance_eval(&block) if block
end
rescue LoadError
ensure
$VERBOSE = old_verbose
end
|