SimpleCov 0.18.3 causes NameError during tests
I observed the following error when running tests after updating SimpleCov from 0.18.2 to 0.18.3.
$ bin/rails test test/functional/email_addresses_controller_test.rb Run options: --seed 4397 # Running: ................ Finished in 4.072047s, 3.9292 runs/s, 10.8054 assertions/s. 16 runs, 44 assertions, 0 failures, 0 errors, 0 skips Traceback (most recent call last): 2: from /Users/maeda/redmines/gems/ruby/2.6.0/gems/minitest-5.14.0/lib/minitest.rb:64:in `block (2 levels) in autorun' 1: from /Users/maeda/redmines/gems/ruby/2.6.0/gems/minitest-5.14.0/lib/minitest.rb:64:in `reverse_each' /Users/maeda/redmines/gems/ruby/2.6.0/gems/simplecov-0.18.3/lib/minitest/simplecov_plugin.rb:8:in `block in plugin_simplecov_init': uninitialized constant Minitest::SimpleCov (NameError)
#2 Updated by Go MAEDA about 1 month ago
You don't see the error if the following change is applied (it is just a workaround. I don't intend to commit the change as is. I think more deep inspection is needed).
diff --git a/test/test_helper.rb b/test/test_helper.rb index b3956e9af..10f8f52fd 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -17,8 +17,8 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +require 'simplecov' if ENV["COVERAGE"] - require 'simplecov' require File.expand_path(File.dirname(__FILE__) + "/coverage/html_formatter") SimpleCov.formatter = Redmine::Coverage::HtmlFormatter SimpleCov.start 'rails'