Skip to content

Commit 9954dab

Browse files
hsbtko1kou
authored
Support Ractor#value (#134)
from https://bugs.ruby-lang.org/issues/21262 We need to alias `Ractor#value` to `Ractor#take` for old versions of Ruby. --------- Co-authored-by: Koichi Sasada <ko1@atdot.net> Co-authored-by: Sutou Kouhei <kou@clear-code.com>
1 parent fad26ee commit 9954dab

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/stringio/test_ractor.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ def setup
88

99
def test_ractor
1010
assert_in_out_err([], <<-"end;", ["true"], [])
11+
class Ractor
12+
alias value take unless method_defined? :value # compat with Ruby 3.4 and olders
13+
end
14+
1115
require "stringio"
1216
$VERBOSE = nil
1317
r = Ractor.new do
@@ -17,7 +21,7 @@ def test_ractor
1721
io.puts "def"
1822
"\0\0\0\0def\n" == io.string
1923
end
20-
puts r.take
24+
puts r.value
2125
end;
2226
end
2327
end

0 commit comments

Comments
 (0)