2020-12-19 18:40:47 +03:00
|
|
|
# frozen_string_literal: true
|
|
|
|
require "test/unit"
|
|
|
|
require "pathname"
|
|
|
|
|
|
|
|
class TestPathnameRactor < Test::Unit::TestCase
|
|
|
|
def setup
|
2021-09-07 06:21:49 +03:00
|
|
|
omit unless defined? Ractor
|
2020-12-19 18:40:47 +03:00
|
|
|
end
|
|
|
|
|
|
|
|
def test_ractor_shareable
|
|
|
|
assert_separately([], "#{<<~"begin;"}\n#{<<~'end;'}")
|
|
|
|
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)
|
|
|
|
end;
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|