diff --git a/.gitignore b/.gitignore index 32af8a97..f9bf6839 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,7 @@ vendor/.bundle !/log/.keep !/tmp/.keep .env +coverage # Ignore Byebug command history file. .byebug_history diff --git a/Gemfile b/Gemfile index 6cf5b618..75554816 100644 --- a/Gemfile +++ b/Gemfile @@ -49,6 +49,11 @@ group :development do gem 'spring-watcher-listen', '~> 2.0.0' end +group :test do + gem 'mocha' + gem 'simplecov', :require => false +end + group :production do # For more condensed logging gem "lograge" diff --git a/Gemfile.lock b/Gemfile.lock index 0a422138..999bd378 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -56,6 +56,7 @@ GEM coffee-script-source (1.10.0) concurrent-ruby (1.0.2) debug_inspector (0.0.2) + docile (1.1.5) dotenv (2.1.1) dotenv-rails (2.1.1) dotenv (= 2.1.1) @@ -99,12 +100,15 @@ GEM nokogiri (>= 1.5.9) mail (2.6.4) mime-types (>= 1.16, < 4) + metaclass (0.0.4) method_source (0.8.2) mime-types (3.1) mime-types-data (~> 3.2015) mime-types-data (3.2016.0521) mini_portile2 (2.1.0) minitest (5.9.1) + mocha (1.2.1) + metaclass (~> 0.0.1) multi_json (1.12.1) multi_xml (0.5.5) multipart-post (2.0.0) @@ -177,6 +181,11 @@ GEM sprockets (>= 2.8, < 4.0) sprockets-rails (>= 2.0, < 4.0) tilt (>= 1.1, < 3) + simplecov (0.13.0) + docile (~> 1.1.0) + json (>= 1.8, < 3) + simplecov-html (~> 0.10.0) + simplecov-html (0.10.0) spring (2.0.0) activesupport (>= 4.2) spring-watcher-listen (2.0.1) @@ -228,6 +237,7 @@ DEPENDENCIES jquery-ui-rails listen (~> 3.0.5) lograge + mocha omniauth (= 1.3.1) omniauth-google-oauth2 (= 0.4.1) omniauth-twitter (= 1.2.1) @@ -236,6 +246,7 @@ DEPENDENCIES rails (~> 5.0.0, >= 5.0.0.1) rails-timeago (~> 2.0) sass-rails (~> 5.0) + simplecov spring spring-watcher-listen (~> 2.0.0) sqlite3 diff --git a/test/test_helper.rb b/test/test_helper.rb index da9519e1..61a1b471 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -15,8 +15,20 @@ # with BigBlueButton; if not, see . ENV['RAILS_ENV'] ||= 'test' + +require 'simplecov' +SimpleCov.start do + add_group 'Models', 'app/models' + add_group 'Controllers', 'app/controllers' + add_group 'Helpers', 'app/helpers' + add_group 'Config', 'config/' + add_group 'Libraries', 'lib/' + add_group 'Tests', 'test/' +end + require File.expand_path('../../config/environment', __FILE__) require 'rails/test_help' +require "mocha/test_unit" class ActiveSupport::TestCase # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.