We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent babf50e commit 33a026fCopy full SHA for 33a026f
bootstraptest/test_ractor.rb
@@ -1187,16 +1187,19 @@ def /(other)
1187
[a.frozen?, a[0].frozen?] == [true, false]
1188
}
1189
1190
-# Ractor.make_shareable(a_proc) is not supported now.
1191
-assert_equal 'true', %q{
1192
- pr = Proc.new{}
+# Ractor.make_shareable(a_proc) requires a shareable receiver
+assert_equal '[:ok, :error]', %q{
+ pr1 = nil.instance_exec { Proc.new{} }
1193
+ pr2 = Proc.new{}
1194
- begin
1195
- Ractor.make_shareable(pr)
1196
- rescue Ractor::Error
1197
- true
1198
- else
1199
- false
+ [pr1, pr2].map do |pr|
+ begin
+ Ractor.make_shareable(pr)
+ rescue Ractor::Error
+ :error
1200
+ else
1201
+ :ok
1202
+ end
1203
end
1204
1205
0 commit comments