Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

Commit

Permalink
Add a Rake task to push merged reports to Coveralls
Browse files Browse the repository at this point in the history
  • Loading branch information
laserlemon committed Mar 6, 2013
1 parent ed9db90 commit bd18ecf
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
12 changes: 12 additions & 0 deletions Rakefile
Expand Up @@ -28,6 +28,18 @@ end

task :env do
ENV["ADAPTER"] = nil
ENV["COVERAGE"] = "true"
end

task :coveralls do
require "simplecov"
require "coveralls"

Coveralls::SimpleCov::Formatter.new.format(SimpleCov.result)
end

Rake::Task[:spec].enhance do
Rake::Task[:coveralls].invoke
end

task default: :spec
16 changes: 5 additions & 11 deletions spec/spec_helper.rb
@@ -1,17 +1,11 @@
require "simplecov"
require "coveralls"

SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
SimpleCov::Formatter::HTMLFormatter,
Coveralls::SimpleCov::Formatter
]

adapter, gemfile = ENV["ADAPTER"], ENV["BUNDLE_GEMFILE"]
adapter ||= gemfile && gemfile[%r(gemfiles/(.*?)/)] && $1

SimpleCov.command_name(adapter)
SimpleCov.start do
add_filter("spec")
if ENV["COVERAGE"]
require "simplecov"

SimpleCov.command_name(adapter)
SimpleCov.start { add_filter("spec") }
end

require "periscope"
Expand Down

0 comments on commit bd18ecf

Please sign in to comment.