Skip to content

Commit 257ad6a

Browse files
bjfisheregon
authored andcommitted
Fix exception creation when Errno is subclassed
1 parent d690322 commit 257ad6a

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

core/exception/errno_spec.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,12 @@
5656
end
5757
end
5858
end
59+
60+
describe "Errno::ENOENT" do
61+
it "lets subclasses inherit the default error message" do
62+
c = Class.new(Errno::ENOENT)
63+
raise c, "custom message"
64+
rescue => e
65+
e.message.should == "No such file or directory - custom message"
66+
end
67+
end

0 commit comments

Comments
 (0)