brew-cask-tests: import Rakefile logic.

This avoids a `rake` dependency in the Gemfile and an unnecessary shell
out.
This commit is contained in:
Mike McQuaid 2017-01-26 12:01:54 +00:00
parent b5f1db5f29
commit 92b48ac42e
2 changed files with 4 additions and 18 deletions

View File

@ -1,17 +0,0 @@
require "rake/testtask"
require "rspec/core/rake_task"
$LOAD_PATH.unshift(File.expand_path("#{ENV["HOMEBREW_REPOSITORY"]}/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

View File

@ -52,6 +52,9 @@ repo_root.cd do
if upload_coverage if upload_coverage
puts "Submitting Codecov coverage..." puts "Submitting Codecov coverage..."
system "bundle", "exec", "rake", "test:coverage:upload" require "simplecov"
require "codecov"
formatter = SimpleCov::Formatter::Codecov.new
formatter.format(SimpleCov::ResultMerger.merged_result)
end end
end end