Project

General

Profile

Actions

Patch #37883

closed

Limit mocha version to < 2.0.0 when Ruby version is < 2.7 to avoid test error

Added by Ko Nagase over 1 year ago. Updated over 1 year ago.

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

0%

Estimated time:

Description

Today, I encountered the following "LoadError: cannot load such file -- ruby2_keywords" error, when executing test with ruby 2.6.
% bundle exec rails test
/Users/sanak/Build/rb/redmine42/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.8.1/lib/active_support/dependencies.rb:291:in `require': cannot load such file -- ruby2_keywords (LoadError)
    from /Users/sanak/Build/rb/redmine42/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.8.1/lib/active_support/dependencies.rb:291:in `block in require'
    from /Users/sanak/Build/rb/redmine42/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.8.1/lib/active_support/dependencies.rb:257:in `load_dependency'
    from /Users/sanak/Build/rb/redmine42/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.8.1/lib/active_support/dependencies.rb:291:in `require'
    from /Users/sanak/Build/rb/redmine42/vendor/bundle/ruby/2.6.0/gems/mocha-2.0.0/lib/mocha/mock.rb:1:in `<top (required)>'
:
The same test was no problem at 2022/10/29, and from checking the installed gem diff, the cause seems to be mocha 2.0.0 which was released at 2022/11/01. From the following mocha document, the latest 2.0.0 only supports ruby >= 2.7,

so, when ruby < 2.7, mocha should be < 2.0.0.

I upload a patch for that, but I am not sure whether it is enough, so reviewing it is helpful.


Files


Related issues

Related to Redmine - Patch #39070: Allow using the latest version of mocha even when using Ruby < 2.7ClosedGo MAEDA

Actions
Actions #1

Updated by Go MAEDA over 1 year ago

  • Subject changed from Limit mocha < 2.0.0 when ruby < 2.7 to avoid test error to Limit mocha version to < 2.0.0 when Ruby version is < 2.7 to avoid test error
  • Status changed from New to Closed
  • Assignee set to Go MAEDA
  • Target version set to 4.2.9

Committed the fix. Thank you for your contribution.

Actions #2

Updated by Go MAEDA 7 months ago

  • Related to Patch #39070: Allow using the latest version of mocha even when using Ruby < 2.7 added
Actions

Also available in: Atom PDF