Actions
Patch #32592
closedRequire 'mocha/minitest' instead of deprecated 'mocha/setup'
Description
The following deprecation warning is shown when running tests if mocha 1.10.0 or later is installed.
Mocha deprecation warning at /path/to/gems/ruby/2.3.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require': Require 'mocha/test_unit', 'mocha/minitest' or 'mocha/api' instead of 'mocha/setup'.
It can be fixed with the following patch.
diff --git a/test/test_helper.rb b/test/test_helper.rb
index 68e292848..0c1217fea 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -35,7 +35,7 @@ require File.expand_path(File.dirname(__FILE__) + '/object_helpers')
include ObjectHelpers
require 'net/ldap'
-require 'mocha/setup'
+require 'mocha/minitest'
require 'fileutils'
Redmine::SudoMode.disable!
Files
Updated by Go MAEDA almost 5 years ago
- File 32592-v2.patch 32592-v2.patch added
Since mocha prior to 1.4.0 does not have 'mocha/minitest', I think it is better to specify the minimum version in Gemfile.
https://github.com/freerange/mocha/blob/master/RELEASE.md#140
Attaching an updated patch.
Updated by Go MAEDA almost 5 years ago
- Status changed from New to Closed
- Assignee set to Go MAEDA
Committed the patch.
Actions