aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_find.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-02-19 14:38:28 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-02-19 14:38:28 +0000
commit88afcb09beae9807fd4c763020b16bff16b3c6b4 (patch)
treea01d6e10e54e4b92b7971d9371f3c519e312de78 /test/test_find.rb
parenta82fb88f12a7d15297517f50b35304d2af38958a (diff)
downloadruby-88afcb09beae9807fd4c763020b16bff16b3c6b4.tar.gz
find.rb: raise with the name
* lib/find.rb (Find#find): raise with the given path name if it does not exist. [ruby-dev:49497] [Bug #12087] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53874 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/test_find.rb')
-rw-r--r--test/test_find.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/test_find.rb b/test/test_find.rb
index d0e92067f1..e3663e47b2 100644
--- a/test/test_find.rb
+++ b/test/test_find.rb
@@ -12,6 +12,17 @@ class TestFind < Test::Unit::TestCase
}
end
+ def test_nonexistence
+ bug12087 = '[ruby-dev:49497] [Bug #12087]'
+ Dir.mktmpdir {|d|
+ path = "#{d}/a"
+ re = /#{Regexp.quote(path)}\z/
+ assert_raise_with_message(Errno::ENOENT, re, bug12087) {
+ Find.find(path) {}
+ }
+ }
+ end
+
def test_rec
Dir.mktmpdir {|d|
File.open("#{d}/a", "w"){}