Skip to content

Commit 141f9cf

Browse files
hsbtko1
andauthored
Support Ractor#value (#157)
This is same as ruby/stringio#134 --------- Co-authored-by: Koichi Sasada <[email protected]>
1 parent 32fec70 commit 141f9cf

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/strscan/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;", ["stra", " ", "strb", " ", "strc"], [])
11+
class Ractor
12+
alias value take unless method_defined? :value # compat with Ruby 3.4 and olders
13+
end
14+
1115
require "strscan"
1216
$VERBOSE = nil
1317
r = Ractor.new do
@@ -22,7 +26,7 @@ def test_ractor
2226
s.scan(/\\w+/)
2327
]
2428
end
25-
puts r.take.compact
29+
puts r.value.compact
2630
end;
2731
end
2832
end

0 commit comments

Comments
 (0)