Merge pull request #192 from tsujigiri/coverage

Make tests fail if test coverage drops
This commit is contained in:
Helge Rausch
2015-10-05 10:22:59 +02:00
6 changed files with 14 additions and 3 deletions

3
.gitignore vendored
View File

@@ -3,7 +3,8 @@ api_key.txt
config/app_config.yml
config/database.yml
config/newrelic.yml
coverage
coverage/*
!coverage/.last_run.json
db/*.sqlite3
development.log
dump.rdb

3
.simplecov Normal file
View File

@@ -0,0 +1,3 @@
SimpleCov.start('rails') do
refuse_coverage_drop
end

View File

@@ -1,7 +1,5 @@
language: ruby # Defaults to ruby, but travis-ci recommends making this explicit.
rvm:
- 2.0
- 2.1
- 2.2
env: DB=postgres CI=1
bundler_args: --without development debug

View File

@@ -5,6 +5,8 @@ rescue LoadError
end
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
require 'simplecov' if ENV['RAILS_ENV'] == 'test'
APP_PATH = File.expand_path('../../config/application', __FILE__)
require File.expand_path('../../config/boot', __FILE__)
require 'rails/commands'

5
coverage/.last_run.json Normal file
View File

@@ -0,0 +1,5 @@
{
"result": {
"covered_percent": 51.52
}
}

View File

@@ -1,5 +1,7 @@
# This file is copied to spec/ when you run 'rails generate rspec:install'
ENV["RAILS_ENV"] ||= 'test'
require 'simplecov'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'sidekiq/testing'