diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | test/rdoc/test_rdoc_rubygems_hook.rb | 23 |
2 files changed, 21 insertions, 9 deletions
@@ -1,3 +1,10 @@ +Sat Dec 1 02:08:16 2012 NAKAMURA Usaku <usa@ruby-lang.org> + + * test/rdoc/test_rdoc_rubygems_hook.rb + (TestRDocRubygemsHook#test_setup_unwritable): 1. check the existance + of the file(directory) before touch it. 2. remove test + file(directory) after the test. see [ruby-core:50388]. + Sat Dec 1 01:51:06 2012 Koichi Sasada <ko1@atdot.net> [EXPERIMENTAL] diff --git a/test/rdoc/test_rdoc_rubygems_hook.rb b/test/rdoc/test_rdoc_rubygems_hook.rb index ceea0dfe12..beba030c94 100644 --- a/test/rdoc/test_rdoc_rubygems_hook.rb +++ b/test/rdoc/test_rdoc_rubygems_hook.rb @@ -202,16 +202,21 @@ class TestRDocRubygemsHook < Gem::TestCase def test_setup_unwritable skip 'chmod not supported' if Gem.win_platform? - FileUtils.mkdir_p @a.doc_dir - FileUtils.chmod 0, @a.doc_dir - - e = assert_raises Gem::FilePermissionError do - @hook.setup + begin + FileUtils.mkdir_p @a.doc_dir + FileUtils.chmod 0, @a.doc_dir + + e = assert_raises Gem::FilePermissionError do + @hook.setup + end + + assert_equal @a.doc_dir, e.directory + ensure + if File.exist? @a.doc_dir + FileUtils.chmod 0755, @a.doc_dir + FileUtils.rm_r @a.doc_dir + end end - - assert_equal @a.doc_dir, e.directory - ensure - FileUtils.chmod 0755, @a.doc_dir end end |