Project

General

Profile

Actions

Patch #32592

closed

Require 'mocha/minitest' instead of deprecated 'mocha/setup'

Added by Go MAEDA over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Gems support
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:

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

32592-v2.patch (710 Bytes) 32592-v2.patch Go MAEDA, 2019-12-11 02:41
Actions #1

Updated by Go MAEDA over 4 years ago

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.

Actions #2

Updated by Go MAEDA over 4 years ago

  • Status changed from New to Closed
  • Assignee set to Go MAEDA

Committed the patch.

Actions

Also available in: Atom PDF