diff options
author | Satoshi Tagomori <[email protected]> | 2024-07-29 11:50:35 +0900 |
---|---|---|
committer | Yusuke Endoh <[email protected]> | 2024-07-30 15:31:24 +0900 |
commit | 50a0552bd7a82d23b836e895a1f380bcdfb5b4a0 (patch) | |
tree | e5e9a166b4de0c89b87b58643576624783d6c389 /test/-ext- | |
parent | ac5ac48a361d3fa91a118b59740a2a9b63ddd90e (diff) |
Fix test code and extension to avoid using gvars and Kernel methods
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/11254
Diffstat (limited to 'test/-ext-')
-rw-r--r-- | test/-ext-/test_ensure_and_callcc.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/test/-ext-/test_ensure_and_callcc.rb b/test/-ext-/test_ensure_and_callcc.rb index 90f8abbb3c..2e29755699 100644 --- a/test/-ext-/test_ensure_and_callcc.rb +++ b/test/-ext-/test_ensure_and_callcc.rb @@ -3,8 +3,6 @@ require 'test/unit' class TestEnsureAndCallcc < Test::Unit::TestCase - require '-test-/ensure_and_callcc' - def test_bug20655_dir_chdir_using_rb_ensure need_continuation called = 0 @@ -21,9 +19,11 @@ class TestEnsureAndCallcc < Test::Unit::TestCase def test_bug20655_extension_using_rb_ensure need_continuation - $ensure_called = 0 - require_with_ensure(File.join(__dir__, 'required')) - assert_equal(1, $ensure_called, "BUG #20655: ensure called unexpectedly in the required script even without exceptions") + require '-test-/ensure_and_callcc' + assert_equal(0, EnsureAndCallcc.ensure_called) + EnsureAndCallcc.require_with_ensure(File.join(__dir__, 'required')) + assert_equal(1, EnsureAndCallcc.ensure_called, + "BUG #20655: ensure called unexpectedly in the required script even without exceptions") end private |