プロジェクト

全般

プロフィール

Vote #80534

完了

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

Admin Redmine さんが約4年前に追加. 約4年前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
Gems support_45
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
45
version_id:
156
issue_org_id:
32592
author_id:
332
assigned_to_id:
332
comments:
2
status_id:
5
tracker_id:
3
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

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!

journals

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.
--------------------------------------------------------------------------------
Committed the patch.
--------------------------------------------------------------------------------

Admin Redmine さんが約4年前に更新

  • カテゴリGems support_45 にセット
  • 対象バージョン3.4.13_156 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0