diff --git a/.gitignore b/.gitignore index 0e6ca9a..30b4c81 100644 --- a/.gitignore +++ b/.gitignore @@ -24,6 +24,7 @@ /public/assets/ /.byebug_history /.rake_tasks~ +/coverage/ # Ignore master key for decrypting credentials and more. /config/master.key diff --git a/.simplecov b/.simplecov new file mode 100644 index 0000000..14b99e3 --- /dev/null +++ b/.simplecov @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +SimpleCov.start 'rails' do + add_filter '/spec/' + + add_group 'Channels', '/app/channels/' +end diff --git a/Gemfile b/Gemfile index eceb62b..5d830ac 100644 --- a/Gemfile +++ b/Gemfile @@ -58,3 +58,9 @@ group :development do gem 'spring' gem 'spring-watcher-listen', '~> 2.0.0' end + +group :test do + # Code coverage for Ruby 1.9+ with a powerful configuration library + # and automatic merging of coverage across test suites. + gem 'simplecov', '~> 0.16', require: false +end diff --git a/Gemfile.lock b/Gemfile.lock index 60ce644..384805b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -53,6 +53,7 @@ GEM concurrent-ruby (1.1.3) crass (1.0.4) diff-lcs (1.3) + docile (1.3.1) erubi (1.7.1) execjs (2.7.0) ffi (1.9.25) @@ -61,6 +62,7 @@ GEM i18n (1.1.1) concurrent-ruby (~> 1.0) jaro_winkler (1.5.1) + json (2.1.0) listen (3.1.5) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) @@ -162,6 +164,11 @@ GEM sprockets (>= 2.8, < 4.0) sprockets-rails (>= 2.0, < 4.0) tilt (>= 1.1, < 3) + simplecov (0.16.1) + docile (~> 1.1) + json (>= 1.8, < 3) + simplecov-html (~> 0.10.0) + simplecov-html (0.10.2) spring (2.0.2) activesupport (>= 4.2) spring-watcher-listen (2.0.1) @@ -208,6 +215,7 @@ DEPENDENCIES rspec-rails (~> 3.8) rubocop (~> 0.60.0) sass-rails (~> 5.0) + simplecov (~> 0.16) spring spring-watcher-listen (~> 2.0.0) turbolinks (~> 5) diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index c5d9a65..fcfaf33 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -1,5 +1,8 @@ # frozen_string_literal: true +# This should be on the top of the file. +require 'simplecov' + # This file is copied to spec/ when you run 'rails generate rspec:install' require 'spec_helper' ENV['RAILS_ENV'] ||= 'test' diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 6faa1fd..795e596 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,5 +1,8 @@ # frozen_string_literal: true +# This should be on the top of the file. +require 'simplecov' + # 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`. The generated `.rspec` file contains