diff options
Diffstat (limited to 'test/pathname/test_ractor.rb')
| -rw-r--r-- | test/pathname/test_ractor.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/test/pathname/test_ractor.rb b/test/pathname/test_ractor.rb index 3d7b63deed..737e4a4111 100644 --- a/test/pathname/test_ractor.rb +++ b/test/pathname/test_ractor.rb @@ -9,14 +9,22 @@ class TestPathnameRactor < Test::Unit::TestCase def test_ractor_shareable assert_separately([], "#{<<~"begin;"}\n#{<<~'end;'}") + class Ractor + alias value take + end unless Ractor.method_defined? :value # compat with Ruby 3.4 and olders + begin; $VERBOSE = nil require "pathname" r = Ractor.new Pathname("a") do |x| x.join(Pathname("b"), Pathname("c")) end - assert_equal(Pathname("a/b/c"), r.take) + assert_equal(Pathname("a/b/c"), r.value) + + r = Ractor.new Pathname("a") do |a| + Pathname("b").relative_path_from(a) + end + assert_equal(Pathname("../b"), r.value) end; end end - |
