cask-tests: fix loading simplecov

This commit is contained in:
Alyssa Ross 2016-09-20 16:39:16 +01:00
parent 869fb02149
commit ad17bbff9c
2 changed files with 13 additions and 4 deletions

View File

@ -6,6 +6,18 @@ homebrew_repo = `brew --repository`.chomp
$LOAD_PATH.unshift(File.expand_path("#{homebrew_repo}/Library/Homebrew")) $LOAD_PATH.unshift(File.expand_path("#{homebrew_repo}/Library/Homebrew"))
$LOAD_PATH.unshift(File.expand_path("../lib", __FILE__)) $LOAD_PATH.unshift(File.expand_path("../lib", __FILE__))
namespace :test do
namespace :coverage do
desc "Upload coverage to Codecov"
task :upload do
require "simplecov"
require "codecov"
formatter = SimpleCov::Formatter::Codecov.new
formatter.format(SimpleCov::ResultMerger.merged_result)
end
end
end
RuboCop::RakeTask.new(:rubocop) do |t| RuboCop::RakeTask.new(:rubocop) do |t|
t.options = ["--force-exclusion"] t.options = ["--force-exclusion"]
end end

View File

@ -38,10 +38,7 @@ repo_root.cd do
end end
if ENV["CODECOV_TOKEN"] if ENV["CODECOV_TOKEN"]
require "simplecov" system "bundle", "exec", "rake", "test:coverage:upload"
require "codecov"
formatter = SimpleCov::Formatter::Codecov.new
formatter.format(SimpleCov::ResultMerger.merged_result)
end end
Homebrew.failed = !$CHILD_STATUS.success? Homebrew.failed = !$CHILD_STATUS.success?