Skip to content

Commit cf27359

Browse files
committed
Adapt Ractor spec for Ruby 4.0
1 parent 38c0720 commit cf27359

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

spec/integration/ractor_spec.rb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
Wasmtime::Instance.new(store, mod).invoke("hello")
2222
end
2323

24-
result = r.take
24+
result = value(r)
2525
expect(result).to eq([1, 2, 3.0, 4.0])
2626
end
2727

@@ -42,7 +42,13 @@
4242
end
4343

4444
ractors.each do |ractor|
45-
expect(ractor.take).to eq([1, 2, 3.0, 4.0])
45+
expect(value(ractor)).to eq([1, 2, 3.0, 4.0])
4646
end
4747
end
48+
49+
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("4.0")
50+
def value(ractor) = ractor.value
51+
else
52+
def value(ractor) = ractor.take
53+
end
4854
end

0 commit comments

Comments
 (0)