.simplecov: delete private method
This commit is contained in:
parent
1dd06e471d
commit
d63a0ebd7b
@ -21,6 +21,11 @@ SimpleCov.start do
|
|||||||
# be quiet, the parent process will be in charge of output and checking coverage totals
|
# be quiet, the parent process will be in charge of output and checking coverage totals
|
||||||
SimpleCov.print_error_status = false
|
SimpleCov.print_error_status = false
|
||||||
end
|
end
|
||||||
|
excludes = ["test", "vendor"]
|
||||||
|
subdirs = Dir.chdir(SimpleCov.root) { Dir.glob("*") }
|
||||||
|
.reject { |d| d.end_with?(".rb") || excludes.include?(d) }
|
||||||
|
.map { |d| "#{d}/**/*.rb" }.join(",")
|
||||||
|
files = "#{SimpleCov.root}/{#{subdirs},*.rb}"
|
||||||
|
|
||||||
if ENV["HOMEBREW_INTEGRATION_TEST"]
|
if ENV["HOMEBREW_INTEGRATION_TEST"]
|
||||||
# This needs a unique name so it won't be ovewritten
|
# This needs a unique name so it won't be ovewritten
|
||||||
@ -32,8 +37,12 @@ SimpleCov.start do
|
|||||||
SimpleCov.at_exit do
|
SimpleCov.at_exit do
|
||||||
# Just save result, but don't write formatted output.
|
# Just save result, but don't write formatted output.
|
||||||
coverage_result = Coverage.result
|
coverage_result = Coverage.result
|
||||||
# TODO: this method is private, find a better way.
|
coverage_result_dup = coverage_result.dup
|
||||||
SimpleCov.send(:add_not_loaded_files, coverage_result)
|
Dir[files].each do |file|
|
||||||
|
absolute_path = File.expand_path(file)
|
||||||
|
coverage_result_dup[absolute_path] ||= SimpleCov::SimulateCoverage.call(absolute_path)
|
||||||
|
end
|
||||||
|
coverage_result = coverage_result_dup
|
||||||
simplecov_result = SimpleCov::Result.new(coverage_result)
|
simplecov_result = SimpleCov::Result.new(coverage_result)
|
||||||
SimpleCov::ResultMerger.store_result(simplecov_result)
|
SimpleCov::ResultMerger.store_result(simplecov_result)
|
||||||
|
|
||||||
@ -45,14 +54,9 @@ SimpleCov.start do
|
|||||||
else
|
else
|
||||||
command_name "#{command_name} (#{$PROCESS_ID})"
|
command_name "#{command_name} (#{$PROCESS_ID})"
|
||||||
|
|
||||||
excludes = ["test", "vendor"]
|
|
||||||
subdirs = Dir.chdir(SimpleCov.root) { Dir.glob("*") }
|
|
||||||
.reject { |d| d.end_with?(".rb") || excludes.include?(d) }
|
|
||||||
.map { |d| "#{d}/**/*.rb" }.join(",")
|
|
||||||
|
|
||||||
# Not using this during integration tests makes the tests 4x times faster
|
# Not using this during integration tests makes the tests 4x times faster
|
||||||
# without changing the coverage.
|
# without changing the coverage.
|
||||||
track_files "#{SimpleCov.root}/{#{subdirs},*.rb}"
|
track_files files
|
||||||
end
|
end
|
||||||
|
|
||||||
add_filter %r{^/build.rb$}
|
add_filter %r{^/build.rb$}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user