summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorKenta Murata <mrkn@users.noreply.github.com>2020-12-20 00:40:47 +0900
committerGitHub <noreply@github.com>2020-12-20 00:40:47 +0900
commitde80b928910b7ca785725382cec53cb27f1d65ed (patch)
tree2d2c327c2865e047e6d5e4402488a3eac54b263a /test
parentd62414b48fbb944cc9e4442ad7d04d40a27fa4e9 (diff)
[pathname] Make Pathname Ractor safe (#3940)
Notes
Notes: Merged-By: mrkn <mrkn@ruby-lang.org>
Diffstat (limited to 'test')
-rw-r--r--test/pathname/test_ractor.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/pathname/test_ractor.rb b/test/pathname/test_ractor.rb
new file mode 100644
index 0000000000..9ce43ef640
--- /dev/null
+++ b/test/pathname/test_ractor.rb
@@ -0,0 +1,22 @@
+# frozen_string_literal: true
+require "test/unit"
+require "pathname"
+
+class TestPathnameRactor < Test::Unit::TestCase
+ def setup
+ skip unless defined? Ractor
+ 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
+