Skip to content

Commit

Permalink
test: use Test::Unit::TestCase.ractor
Browse files Browse the repository at this point in the history
Instead of using assert_separately. If we use .ractor, we can use the
same process for tests that use Ractor. It's easy to debug.
  • Loading branch information
kou committed Apr 30, 2024
1 parent 9d01900 commit 64b5c78
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions test/pathname/test_ractor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,14 @@
require "pathname"

class TestPathnameRactor < Test::Unit::TestCase
def setup
omit unless defined? Ractor
end

def test_ractor_shareable
assert_separately([], "#{<<~"begin;"}\n#{<<~'end;'}")
begin;
$VERBOSE = nil
require "pathname"
if respond_to?(:ractor)
ractor
def test_shareable
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
end

0 comments on commit 64b5c78

Please sign in to comment.