summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMarc-Andre Lafortune <github@marc-andre.ca>2020-12-19 12:19:06 -0500
committerMarc-André Lafortune <github@marc-andre.ca>2020-12-19 17:13:08 -0500
commit6343a8112950b12df942f5098edc093bca96ef2d (patch)
tree09eee39bd862b0bed60a3db50fe3f0c24200752c /test
parent67e062b523e1a1bdf597a500027c916c16cd07a1 (diff)
[ruby/ostruct] Add Ractor test
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3942
Diffstat (limited to 'test')
-rw-r--r--test/ostruct/test_ostruct.rb23
1 files changed, 11 insertions, 12 deletions
diff --git a/test/ostruct/test_ostruct.rb b/test/ostruct/test_ostruct.rb
index 9d151c3a2f..3ca98ee739 100644
--- a/test/ostruct/test_ostruct.rb
+++ b/test/ostruct/test_ostruct.rb
@@ -300,19 +300,18 @@ class TC_OpenStruct < Test::Unit::TestCase
assert_equal 42, o.foo
end
-=begin
- # now Ractor should not use in test-all process
def test_ractor
- obj1 = OpenStruct.new(a: 42, b: 42)
- obj1.c = 42
- obj1.freeze
-
- obj2 = Ractor.new obj1 do |obj|
- obj
- end.take
- assert obj1.object_id == obj2.object_id
- end if defined?(Ractor)
-=end
+ assert_ractor(<<~RUBY, require: 'ostruct')
+ obj1 = OpenStruct.new(a: 42, b: 42)
+ obj1.c = 42
+ obj1.freeze
+
+ obj2 = Ractor.new obj1 do |obj|
+ obj
+ end.take
+ assert obj1.object_id == obj2.object_id
+ RUBY
+ end
def test_legacy_yaml
s = "--- !ruby/object:OpenStruct\ntable:\n :foo: 42\n"