Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add a Rake task to push merged reports to Coveralls

  • Loading branch information...
commit bd18ecf81ba9bc3616cd94bfb84a8c63a999fdcc 1 parent ed9db90
@laserlemon authored
Showing with 17 additions and 11 deletions.
  1. +12 −0 Rakefile
  2. +5 −11 spec/spec_helper.rb
View
12 Rakefile
@@ -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
View
16 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"
Please sign in to comment.
Something went wrong with that request. Please try again.