From a68e3a2fb1f7678c75b1d7a66ed9b19ab954891a Mon Sep 17 00:00:00 2001 From: Alexander Meindl Date: Wed, 28 Jun 2017 15:21:30 +0200 Subject: [PATCH 1/2] Add code coverage to tests --- test/test_helper.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/test_helper.rb b/test/test_helper.rb index 689307b..0194583 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -2,6 +2,18 @@ require File.expand_path(File.dirname(__FILE__) + '/../../../test/test_helper') +require 'simplecov' +require 'simplecov-rcov' + +SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[ + SimpleCov::Formatter::HTMLFormatter, + SimpleCov::Formatter::RcovFormatter +] + +SimpleCov.start :rails do + root File.expand_path(File.dirname(__FILE__) + '/..') +end + module RedmineMessenger class TestCase include ActionDispatch::TestProcess From 6295fb3b26252109e96ff0bfd0322a58e7f7169b Mon Sep 17 00:00:00 2001 From: Alexander Meindl Date: Wed, 28 Jun 2017 16:19:37 +0200 Subject: [PATCH 2/2] add_filter init.rb --- test/test_helper.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/test_helper.rb b/test/test_helper.rb index 0194583..752b94a 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,7 +1,5 @@ # Redmine Messenger plugin for Redmine -require File.expand_path(File.dirname(__FILE__) + '/../../../test/test_helper') - require 'simplecov' require 'simplecov-rcov' @@ -11,9 +9,12 @@ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[ ] SimpleCov.start :rails do + add_filter 'init.rb' root File.expand_path(File.dirname(__FILE__) + '/..') end +require File.expand_path(File.dirname(__FILE__) + '/../../../test/test_helper') + module RedmineMessenger class TestCase include ActionDispatch::TestProcess