File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
activesupport/test/core_ext Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -362,11 +362,19 @@ def test_sole
362
362
end
363
363
364
364
def test_doesnt_bust_constant_cache
365
- skip "Only applies to MRI" unless defined? ( RubyVM . stat ) && RubyVM . stat ( :global_constant_state )
365
+ skip "Only applies to MRI" unless defined? ( RubyVM . stat )
366
366
367
367
object = Object . new
368
- assert_no_difference -> { RubyVM . stat ( :global_constant_state ) } do
368
+ assert_no_difference -> { constant_cache_invalidations } do
369
369
object . extend ( Enumerable )
370
370
end
371
371
end
372
+
373
+ private
374
+
375
+ def constant_cache_invalidations
376
+ RubyVM . stat ( :constant_cache_invalidations )
377
+ rescue ArgumentError
378
+ RubyVM . stat ( :global_constant_state ) # RUBY_VERSION < "3.2"
379
+ end
372
380
end
You can’t perform that action at this time.
0 commit comments