From 3f117c76b076acdd24ba2b48527a986c92dfa9cc Mon Sep 17 00:00:00 2001 From: Benjamin ter Kuile Date: Tue, 4 Mar 2014 17:23:38 +0100 Subject: [PATCH] Add simplecov --- .gitignore | 1 + Gemfile | 1 + Gemfile.lock | 5 +++++ app/controllers/application_controller.rb | 2 +- spec/spec_helper.rb | 2 ++ 5 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index b487dc0c..a17a25b8 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,4 @@ zeus.json custom_plan.rb public/capybara.html chromedriver.log +/coverage diff --git a/Gemfile b/Gemfile index c63e57e4..143e2a15 100644 --- a/Gemfile +++ b/Gemfile @@ -80,6 +80,7 @@ group :test do gem 'launchy' gem 'fuubar' #gem 'rb-fsevent', :require => false #if RUBY_PLATFORM =~ /darwin/i + gem 'simplecov', require: false gem 'factory_girl_rails' gem 'pry-rails' end diff --git a/Gemfile.lock b/Gemfile.lock index 846290fc..1053eb85 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -304,6 +304,10 @@ GEM simple_form (3.0.1) actionpack (>= 4.0.0, < 4.1) activemodel (>= 4.0.0, < 4.1) + simplecov (0.7.1) + multi_json (~> 1.0) + simplecov-html (~> 0.7.1) + simplecov-html (0.7.1) slim (2.0.2) temple (~> 0.6.6) tilt (>= 1.3.3, < 2.1) @@ -389,6 +393,7 @@ DEPENDENCIES rspec-rails sass-rails simple_form + simplecov simply_stored! slim-rails thin diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 49522182..a69b4d8e 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,5 +1,5 @@ class ApplicationController < ActionController::Base - before_filter :set_locale + before_action :set_locale layout :layout_by_resource #protect_from_forgery diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 9cc6095e..63b3b419 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,5 +1,7 @@ # This file is copied to spec/ when you run 'rails generate rspec:install' ENV["RAILS_ENV"] ||= 'test' +require 'simplecov' +SimpleCov.start 'rails' require File.expand_path("../../config/environment", __FILE__) require 'rspec/rails' require 'rspec/matchers'