diff --git a/.gitignore b/.gitignore index b3fcb2d..8b8af06 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ *.swp /public/uploads/* +/coverage /config/application.yml /config/mongoid.yml diff --git a/Gemfile b/Gemfile index 8c47088..9c7cea5 100644 --- a/Gemfile +++ b/Gemfile @@ -61,6 +61,8 @@ group :test do gem 'database_cleaner' gem 'rspec-sidekiq' gem "codeclimate-test-reporter", group: :test, require: nil + gem 'simplecov' + gem 'simplecov-console' end group :test, :development do diff --git a/Gemfile.lock b/Gemfile.lock index 96e3630..313e28e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -44,6 +44,7 @@ GEM tzinfo (~> 1.1) addressable (2.5.2) public_suffix (>= 2.0.2, < 4.0) + ansi (1.5.0) arel (9.0.0) babel-source (5.8.35) babel-transpiler (0.7.0) @@ -130,6 +131,7 @@ GEM guard (~> 2.1) guard-compat (~> 1.1) rspec (>= 2.99.0, < 4.0) + hirb (0.7.3) html_truncator (0.4.2) nokogiri (~> 1.5) http-cookie (1.0.3) @@ -303,6 +305,10 @@ GEM docile (~> 1.1.0) json (>= 1.8, < 3) simplecov-html (~> 0.10.0) + simplecov-console (0.4.2) + ansi + hirb + simplecov simplecov-html (0.10.2) slim (3.0.9) temple (>= 0.7.6, < 0.9) @@ -396,6 +402,8 @@ DEPENDENCIES sass-rails (~> 5.0) sidekiq simple_form (~> 4.0.0) + simplecov + simplecov-console slim-rails spring spring-watcher-listen (~> 2.0.0) diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index 3a9e143..3cd56bc 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -3,8 +3,13 @@ require File.expand_path('../../config/environment', __FILE__) abort("The Rails environment is running in production mode!") if Rails.env.production? require 'spec_helper' require 'rspec/rails' -Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f} +require 'simplecov' +require 'simplecov-console' +SimpleCov.formatter = SimpleCov.formatter = SimpleCov::Formatter::Console +SimpleCov.start + +Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f} ActiveRecord::Migration.maintain_test_schema! RSpec.configure do |config|