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("../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|
t.options = ["--force-exclusion"]
end

View File

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