diff --git a/Gemfile b/Gemfile index 714d7f01bf..f42717e46a 100644 --- a/Gemfile +++ b/Gemfile @@ -69,6 +69,7 @@ group :test do gem 'rb-readline' # ruby on CI needs this # why in Gemfile? see: https://github.com/guard/guard-test gem 'ruby-prof' + gem 'simplecov', ">= 0.8.pre" gem 'coveralls', :require => false end diff --git a/Gemfile.lock b/Gemfile.lock index 56786565f2..7b91d5a719 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -298,8 +298,8 @@ GEM shoulda-context (1.1.2) shoulda-matchers (2.1.0) activesupport (>= 3.0.0) - simplecov (0.7.1) - multi_json (~> 1.0) + simplecov (0.8.0.pre) + multi_json simplecov-html (~> 0.7.1) simplecov-html (0.7.1) slop (3.4.5) @@ -404,6 +404,7 @@ DEPENDENCIES sass-rails (~> 3.2.3) selenium-webdriver shoulda + simplecov (>= 0.8.pre) sqlite3 sqlite3-ruby (< 1.3) strong_parameters diff --git a/features/support/env.rb b/features/support/env.rb index 05b2c0107b..175bf04dad 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -7,7 +7,8 @@ require 'cucumber/rails' require 'coveralls' -Coveralls.wear_merged!('rails') +require 'simplecov_openproject_profile' +Coveralls.wear_merged!('openproject') # Load paths to ensure they are loaded before the plugin's paths.rbs. # Plugin's path_to functions rely on being loaded after the core's path_to diff --git a/lib/simplecov_openproject_profile.rb b/lib/simplecov_openproject_profile.rb new file mode 100644 index 0000000000..a682c3bdc1 --- /dev/null +++ b/lib/simplecov_openproject_profile.rb @@ -0,0 +1,10 @@ +require 'simplecov' +SimpleCov.profiles.define 'openproject' do + load_profile 'rails' + add_filter '/lib/assets' + add_filter '/lib/plugins/gravatar' + add_filter '/lib/plugins/rfpdf' + add_filter '/lib/SVG' + add_filter '/spec' + add_filter '/features' +end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 57d4fe6627..d33f02271f 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -4,7 +4,8 @@ require 'rubygems' ENV["RAILS_ENV"] ||= 'test' require 'coveralls' -Coveralls.wear_merged!('rails') +require 'simplecov_openproject_profile' +Coveralls.wear_merged!('openproject') require File.expand_path("../../config/environment", __FILE__) require 'rspec/rails' diff --git a/test/test_helper.rb b/test/test_helper.rb index f90a34d50f..7ae62e4898 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -15,7 +15,8 @@ ENV["RAILS_ENV"] = "test" require 'coveralls' -Coveralls.wear_merged!('rails') +require 'simplecov_openproject_profile' +Coveralls.wear_merged!('openproject') require File.expand_path('../../config/environment', __FILE__) require 'rails/test_help'