summaryrefslogtreecommitdiff
path: root/test/strscan/test_ractor.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/strscan/test_ractor.rb')
-rw-r--r--test/strscan/test_ractor.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/test/strscan/test_ractor.rb b/test/strscan/test_ractor.rb
index a5de7e56ed..a13fd8fd13 100644
--- a/test/strscan/test_ractor.rb
+++ b/test/strscan/test_ractor.rb
@@ -3,11 +3,15 @@ require 'test/unit'
class TestStringScannerRactor < Test::Unit::TestCase
def setup
- omit "Ractor not defined" unless defined? Ractor
+ omit("Ractor not defined") unless defined? Ractor
end
def test_ractor
assert_in_out_err([], <<-"end;", ["stra", " ", "strb", " ", "strc"], [])
+ class Ractor
+ alias value take unless method_defined? :value # compat with Ruby 3.4 and olders
+ end
+
require "strscan"
$VERBOSE = nil
r = Ractor.new do
@@ -22,7 +26,7 @@ class TestStringScannerRactor < Test::Unit::TestCase
s.scan(/\\w+/)
]
end
- puts r.take.compact
+ puts r.value.compact
end;
end
end