Move simplecov configuration to dotfile.

This commit is contained in:
Mike McQuaid 2015-07-27 21:50:30 +01:00
parent 76a0b1d494
commit 95658a5beb
2 changed files with 25 additions and 17 deletions

View File

@ -0,0 +1,24 @@
# vim: filetype=ruby
SimpleCov.start do
tests_path = File.dirname(__FILE__)
minimum_coverage 50
coverage_dir File.expand_path("#{tests_path}/coverage")
root File.expand_path("#{tests_path}/..")
add_filter "Homebrew/test/"
add_filter "vendor/bundle/"
add_filter "Homebrew/vendor/"
add_filter "Homebrew/compat/"
end
if name = ENV["HOMEBREW_INTEGRATION_TEST"]
SimpleCov.command_name "brew #{name}"
SimpleCov.at_exit do
exit_code = $!.nil? ? 0 : $!.status
$stdout.reopen("/dev/null")
SimpleCov.result.format!
exit! exit_code
end
end

View File

@ -1,23 +1,7 @@
$:.unshift File.expand_path("../..", __FILE__)
$:.unshift File.expand_path("../lib", __FILE__)
# This must be at the top
if ENV["HOMEBREW_TESTS_COVERAGE"]
require "simplecov"
SimpleCov.start do
tests_path = File.dirname(__FILE__)
minimum_coverage 50
coverage_dir File.expand_path("#{tests_path}/coverage")
root File.expand_path("#{tests_path}/..")
add_filter "Homebrew/test/"
add_filter "vendor/bundle/"
add_filter "Homebrew/vendor/"
add_filter "Homebrew/compat/"
end
end
require "simplecov" if ENV["HOMEBREW_TESTS_COVERAGE"]
require "global"
# Test environment setup