Skip to content

Commit b4a7536

Browse files
committed
Add basic test of close interruption.
1 parent f30c2f8 commit b4a7536

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
@@ -90,4 +90,18 @@
9090
out.close
9191
end
9292
end
93+
94+
with "#close" do
95+
it "can interrupt reading fiber when closing" do
96+
r, w = IO.pipe
97+
98+
read_task = Async do
99+
r.read(5)
100+
end
101+
102+
r.close
103+
104+
expect{read_task.wait}.to raise_exception(IOError)
105+
end
106+
end
93107
end

0 commit comments

Comments
 (0)