From a0e26acc7ae10c2a4b42a7bd47c2065c3182af6b Mon Sep 17 00:00:00 2001 From: akr Date: Mon, 14 Dec 2009 12:50:13 +0000 Subject: * lib/find.rb (Find.find): narrow rescue region. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@26098 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/test_find.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test') diff --git a/test/test_find.rb b/test/test_find.rb index 7e9f21fdd..6f61dd4f3 100644 --- a/test/test_find.rb +++ b/test/test_find.rb @@ -127,6 +127,15 @@ class TestFind < Test::Unit::TestCase } end + def test_dangling_symlink_stat_error + Dir.mktmpdir {|d| + File.symlink("foo", "#{d}/bar") + assert_raise(Errno::ENOENT) { + Find.find(d) {|f| File.stat(f) } + } + } + end + def test_enumerator Dir.mktmpdir {|d| File.open("#{d}/a", "w") -- cgit