test/test_rdoc_options.rb in rdoc-3.5.1 vs test/test_rdoc_options.rb in rdoc-3.5.2

- old
+ new

@@ -15,19 +15,29 @@ def teardown RDoc::RDoc::GENERATORS.replace @generators end def test_check_files - skip "assumes UNIX permission model" if /mswin|mingw/ =~ RUBY_PLATFORM out, err = capture_io do Dir.mktmpdir do |dir| - Dir.chdir dir do - FileUtils.touch 'unreadable' - FileUtils.chmod 0, 'unreadable' + begin + unreadable = nil # variable for windows - @options.files = %w[nonexistent unreadable] + Dir.chdir dir do + if RUBY_PLATFORM =~ /mswin|mingw/ then + unreadable = open 'unreadable' + File.delete 'unreadable' + else + FileUtils.touch 'unreadable' + FileUtils.chmod 0, 'unreadable' + end - @options.check_files + @options.files = %w[nonexistent unreadable] + + @options.check_files + end + ensure + unreadable.close if unreadable end end end assert_empty @options.files