From c0d84b30ba6111b687bcb1bdbe4c6afeaa272cb0 Mon Sep 17 00:00:00 2001 From: "Jesse C. Fisher" Date: Tue, 23 Feb 2016 13:34:02 -0800 Subject: [PATCH] Install simplecov for test coverage stats --- Gemfile | 1 + Gemfile.lock | 7 +++++++ bin/rails | 6 ++++++ config/environments/development.rb | 1 + config/environments/test.rb | 2 +- spec/spec_helper.rb | 2 ++ 6 files changed, 18 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 5f00c202..875714b8 100644 --- a/Gemfile +++ b/Gemfile @@ -64,6 +64,7 @@ group :test, :staging do gem "poltergeist" gem 'launchy' gem 'selenium-webdriver' + gem 'simplecov', :require => false end group :production, :staging do gem 'newrelic_rpm' diff --git a/Gemfile.lock b/Gemfile.lock index 5b636a04..74895682 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -104,6 +104,7 @@ GEM actionmailer (>= 3.2.6, < 5) devise (>= 3.2.0) diff-lcs (1.2.5) + docile (1.1.5) dotenv (2.1.0) dotenv-rails (2.1.0) dotenv (= 2.1.0) @@ -336,6 +337,11 @@ GEM simple_form (3.2.1) actionpack (> 4, < 5.1) activemodel (> 4, < 5.1) + simplecov (0.10.0) + docile (~> 1.1.0) + json (~> 1.8) + simplecov-html (~> 0.10.0) + simplecov-html (0.10.0) slop (3.6.0) spring (1.6.3) spring-commands-rspec (1.0.4) @@ -440,6 +446,7 @@ DEPENDENCIES sdoc (~> 0.4.0) selenium-webdriver simple_form + simplecov spring spring-commands-rspec turbolinks diff --git a/bin/rails b/bin/rails index 728cd85a..601ffafc 100755 --- a/bin/rails +++ b/bin/rails @@ -2,3 +2,9 @@ APP_PATH = File.expand_path('../../config/application', __FILE__) require_relative '../config/boot' require 'rails/commands' + +if ENV['RAILS_ENV'] == 'test' + require 'simplecov' + SimpleCov.start 'rails' + puts "required simplecov" +end diff --git a/config/environments/development.rb b/config/environments/development.rb index d5825777..37bac2a1 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -6,6 +6,7 @@ Rails.application.configure do # since you don't have to restart the web server when you make code changes. config.cache_classes = false + config.serve_static_files = false # Do not eager load code on boot. config.eager_load = false diff --git a/config/environments/test.rb b/config/environments/test.rb index 936ce6cc..67f8bb93 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -13,7 +13,7 @@ Rails.application.configure do config.eager_load = false # Configure static asset server for tests with Cache-Control for performance. - config.serve_static_assets = true + config.serve_static_assets = false config.static_cache_control = 'public, max-age=3600' # Show full error reports and disable caching. diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 936f2a72..8a9b5d44 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,3 +1,5 @@ +require 'simplecov' +SimpleCov.start # This file was generated by the `rails generate rspec:install` command. # Conventionally, all specs live under a `spec` directory, which # RSpec adds to the `$LOAD_PATH`.