summaryrefslogtreecommitdiff
path: root/spec/ruby/core/exception/errno_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/exception/errno_spec.rb')
-rw-r--r--spec/ruby/core/exception/errno_spec.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/ruby/core/exception/errno_spec.rb b/spec/ruby/core/exception/errno_spec.rb
index 095a926e09..a063e522ea 100644
--- a/spec/ruby/core/exception/errno_spec.rb
+++ b/spec/ruby/core/exception/errno_spec.rb
@@ -56,3 +56,12 @@ describe "Errno::ENOTSUP" do
end
end
end
+
+describe "Errno::ENOENT" do
+ it "lets subclasses inherit the default error message" do
+ c = Class.new(Errno::ENOENT)
+ raise c, "custom message"
+ rescue => e
+ e.message.should == "No such file or directory - custom message"
+ end
+end