diff --git a/.travis.yml b/.travis.yml index 8217230..eec469b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,6 @@ language: ruby +env: + - COVERAGE=true rvm: - 1.9.3 - 1.9.2 diff --git a/README.md b/README.md index a9776cc..1f01906 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ [travis-ci-url]: http://travis-ci.org/errbit/errbit [codeclimate-img-url]: https://codeclimate.com/github/errbit/errbit.png [codeclimate-url]: https://codeclimate.com/github/errbit/errbit +[![Coverage Status](https://coveralls.io/repos/errbit/errbit/badge.png?branch=master)](https://coveralls.io/r/errbit/errbit) + ### The open source, self-hosted error catcher diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 5600557..f618312 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,6 +1,22 @@ # This file is copied to ~/spec when you run 'ruby script/generate rspec' # from the project root directory. ENV["RAILS_ENV"] ||= 'test' + +if ENV['COVERAGE'] + require 'coveralls' + require 'simplecov' + Coveralls.wear!('rails') do + add_filter 'bundle' + end + SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[ + SimpleCov::Formatter::HTMLFormatter, + Coveralls::SimpleCov::Formatter + ] + SimpleCov.start('rails') do + add_filter 'bundle' + end +end + require File.expand_path("../../config/environment", __FILE__) require 'rspec/rails' require 'database_cleaner' @@ -8,8 +24,6 @@ require 'webmock/rspec' require 'xmpp4r' require 'xmpp4r/muc' -require 'coveralls' -Coveralls.wear! # Requires supporting files with custom matchers and macros, etc, # in ./support/ and its subdirectories. -- libgit2 0.21.2