Skip to content

Commit 74ba708

Browse files
authored
Add test for blocking IO#gets in task. (#267)
1 parent 0ad0a88 commit 74ba708

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/async/task.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -836,4 +836,16 @@ def sleep_forever
836836
end
837837
end
838838
end
839+
840+
it "can gets in a task" do
841+
IO.pipe do |input, output|
842+
Async do
843+
Async do
844+
expect(input.gets).to be == "hello\n"
845+
end
846+
output.puts "hello"
847+
end
848+
end
849+
end
850+
839851
end

0 commit comments

Comments
 (0)