Skip to content

Commit 41d8974

Browse files
authored
Merge pull request #814 from ruby/port-ractor-change
Forward-port Ractor change from ruby/ruby
2 parents a29cb77 + d42b369 commit 41d8974

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

test/json/ractor_test.rb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@
88
end
99

1010
class JSONInRactorTest < Test::Unit::TestCase
11+
unless Ractor.method_defined?(:value)
12+
module RactorBackport
13+
refine Ractor do
14+
alias_method :value, :take
15+
end
16+
end
17+
18+
using RactorBackport
19+
end
20+
1121
def test_generate
1222
pid = fork do
1323
r = Ractor.new do
@@ -25,7 +35,7 @@ def test_generate
2535
end
2636
expected_json = JSON.parse('{"a":2,"b":3.141,"c":"c","d":[1,"b",3.14],"e":{"foo":"bar"},' +
2737
'"g":"\\"\\u0000\\u001f","h":1000.0,"i":0.001}')
28-
actual_json = r.take
38+
actual_json = r.value
2939

3040
if expected_json == actual_json
3141
exit 0

0 commit comments

Comments
 (0)