Skip to content

Commit 4e0b9f6

Browse files
committed
Add basic test of close interruption.
1 parent aea70d8 commit 4e0b9f6

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/io.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,18 @@
8888
out.close
8989
end
9090
end
91+
92+
with "#close" do
93+
it "can interrupt reading fiber when closing" do
94+
r, w = IO.pipe
95+
96+
read_task = Async do
97+
r.read(5)
98+
end
99+
100+
r.close
101+
102+
expect{read_task.wait}.to raise_exception(IOError)
103+
end
104+
end
91105
end

0 commit comments

Comments
 (0)