Skip to content

Commit aea70d8

Browse files
committed
ChildProcess is not shared between tests, inline it.
1 parent f6b53d2 commit aea70d8

File tree

2 files changed

+12
-19
lines changed

2 files changed

+12
-19
lines changed

fixtures/child_process.rb

-17
This file was deleted.

test/fiber.rb

+12-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
require "async"
77
require "async/variable"
8-
require "child_process"
98

109
describe Fiber do
1110
with ".new" do
@@ -76,8 +75,19 @@
7675
expect(sequence).to be == [0, 1, 2]
7776
end
7877

78+
def spawn_child_ruby(code)
79+
lib_path = File.expand_path("../lib", __dir__)
80+
81+
IO.popen(["ruby", "-I#{lib_path}"], "r+", err: [:child, :out]) do |process|
82+
process.write(code)
83+
process.close_write
84+
85+
return process.read
86+
end
87+
end
88+
7989
it "correctly handles exceptions in process" do
80-
buffer = ChildProcess.spawn(<<~RUBY)
90+
buffer = spawn_child_ruby(<<~RUBY)
8191
require 'async'
8292
8393
scheduler = Async::Scheduler.new

0 commit comments

Comments
 (0)