You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I use minitest/mock on the latest build of Ruby 3.4.0dev, I see this warning:
minitest/mock.rb:33: warning: redefining 'object_id' may cause serious problems
This warning can be demonstrated by running minitest's CI workflow on the master branch, specifically the test ubuntu-latest head job. Here is an example:
Sadly, the best I can come up with is to disable warnings during the offense:
--- //src/minitest/dev/lib/minitest/mock.rb 2024-07-30 23:54:25.000000000 -0700+++ /Users/ryan/Work/p4/zss/src/minitest/dev/lib/minitest/mock.rb 2024-07-30 23:54:25.000000000 -0700@@ -30,6 +30,7 @@
end
overridden_methods.map(&:to_sym).each do |method_id|
+ old_w, $-w = $-w, nil
define_method method_id do |*args, **kwargs, &b|
if @expected_calls.key? method_id then
if kwargs.empty? then # FIX: drop this after 2.7 dead
@@ -45,6 +46,8 @@
end
end
end
+ ensure+ $-w = old_w
end
def initialize delegator = nil # :nodoc:
When I use
minitest/mock
on the latest build of Ruby 3.4.0dev, I see this warning:This warning can be demonstrated by running minitest's CI workflow on the master branch, specifically the test ubuntu-latest head job. Here is an example:
https://github.com/mattbrictson/minitest/actions/runs/11638307079/job/32412919800#step:5:5
Edit: here's a concise reproduction using just
irb
:The text was updated successfully, but these errors were encountered: