Commit b7ed9cc03e215241c4d1e1374e05a2a697eb724d
1 parent
4e542fc4
Exists in
master
and in
1 other branch
Complete the coverall integrations
Add the coverall badge on README Fix coverall coverage to add it on top of spec_helper Add simplecov report generation with launch spec with COVERAGE=true env
Showing
3 changed files
with
20 additions
and
2 deletions
Show diff stats
.travis.yml
README.md
| @@ -4,6 +4,8 @@ | @@ -4,6 +4,8 @@ | ||
| 4 | [travis-ci-url]: http://travis-ci.org/errbit/errbit | 4 | [travis-ci-url]: http://travis-ci.org/errbit/errbit |
| 5 | [codeclimate-img-url]: https://codeclimate.com/github/errbit/errbit.png | 5 | [codeclimate-img-url]: https://codeclimate.com/github/errbit/errbit.png |
| 6 | [codeclimate-url]: https://codeclimate.com/github/errbit/errbit | 6 | [codeclimate-url]: https://codeclimate.com/github/errbit/errbit |
| 7 | +[](https://coveralls.io/r/errbit/errbit) | ||
| 8 | + | ||
| 7 | 9 | ||
| 8 | 10 | ||
| 9 | ### The open source, self-hosted error catcher | 11 | ### The open source, self-hosted error catcher |
spec/spec_helper.rb
| 1 | # This file is copied to ~/spec when you run 'ruby script/generate rspec' | 1 | # This file is copied to ~/spec when you run 'ruby script/generate rspec' |
| 2 | # from the project root directory. | 2 | # from the project root directory. |
| 3 | ENV["RAILS_ENV"] ||= 'test' | 3 | ENV["RAILS_ENV"] ||= 'test' |
| 4 | + | ||
| 5 | +if ENV['COVERAGE'] | ||
| 6 | + require 'coveralls' | ||
| 7 | + require 'simplecov' | ||
| 8 | + Coveralls.wear!('rails') do | ||
| 9 | + add_filter 'bundle' | ||
| 10 | + end | ||
| 11 | + SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[ | ||
| 12 | + SimpleCov::Formatter::HTMLFormatter, | ||
| 13 | + Coveralls::SimpleCov::Formatter | ||
| 14 | + ] | ||
| 15 | + SimpleCov.start('rails') do | ||
| 16 | + add_filter 'bundle' | ||
| 17 | + end | ||
| 18 | +end | ||
| 19 | + | ||
| 4 | require File.expand_path("../../config/environment", __FILE__) | 20 | require File.expand_path("../../config/environment", __FILE__) |
| 5 | require 'rspec/rails' | 21 | require 'rspec/rails' |
| 6 | require 'database_cleaner' | 22 | require 'database_cleaner' |
| @@ -8,8 +24,6 @@ require 'webmock/rspec' | @@ -8,8 +24,6 @@ require 'webmock/rspec' | ||
| 8 | require 'xmpp4r' | 24 | require 'xmpp4r' |
| 9 | require 'xmpp4r/muc' | 25 | require 'xmpp4r/muc' |
| 10 | 26 | ||
| 11 | -require 'coveralls' | ||
| 12 | -Coveralls.wear! | ||
| 13 | 27 | ||
| 14 | # Requires supporting files with custom matchers and macros, etc, | 28 | # Requires supporting files with custom matchers and macros, etc, |
| 15 | # in ./support/ and its subdirectories. | 29 | # in ./support/ and its subdirectories. |