Skip to content

Commit 9ea3b22

Browse files
committed
Handle exception error message differences.
1 parent 5ac290a commit 9ea3b22

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

test/io.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,14 @@
116116
expect do
117117
r.read(5)
118118
end.to raise_exception(IOError, message: be =~ /stream closed/)
119+
ensure
120+
puts "Exiting read task"
119121
end
120122

121123
close_task = Async do
122124
r.close
125+
ensure
126+
puts "Exiting close task"
123127
end
124128

125129
close_task.wait
@@ -188,7 +192,7 @@
188192

189193
expect do
190194
read_thread.join
191-
end.to raise_exception(IOError, message: be =~ /stream closed/)
195+
end.to raise_exception(IOError, message: be =~ /closed/)
192196
end
193197

194198
it "can interrupt reading fiber in a new thread when closing from a fiber" do
@@ -201,7 +205,7 @@
201205
read_task = Async do
202206
expect do
203207
r.read(5)
204-
end.to raise_exception(IOError, message: be =~ /stream closed/)
208+
end.to raise_exception(IOError, message: be =~ /closed/)
205209
end
206210
read_task.wait
207211
end

0 commit comments

Comments
 (0)