summaryrefslogtreecommitdiff
path: root/test/rdoc
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-02-07 01:23:28 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-02-07 01:23:28 +0000
commit55ea57af65eb77af6693ebdeb7025e7ef5c88f6f (patch)
treefdea2eeeaf4813902afef3fc8dd5a80bacb5e3c5 /test/rdoc
parent28937bf81f25eb950afe94809174ffc6eced3dd8 (diff)
* test/rdoc/test_rdoc_options.rb (TestRDocOptions#test_check_files):
there is no easy way to create owner unreadable file on Windows. So, skip the test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30811 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rdoc')
-rw-r--r--test/rdoc/test_rdoc_options.rb42
1 files changed, 19 insertions, 23 deletions
diff --git a/test/rdoc/test_rdoc_options.rb b/test/rdoc/test_rdoc_options.rb
index 8e5ec853cc..eaa10586fd 100644
--- a/test/rdoc/test_rdoc_options.rb
+++ b/test/rdoc/test_rdoc_options.rb
@@ -17,27 +17,28 @@ class TestRDocOptions < MiniTest::Unit::TestCase
end
def test_check_files
+ expected = ''
out, err = capture_io do
Dir.mktmpdir do |dir|
- begin
- unreadable = nil # variable for windows
-
- 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.files = %w[nonexistent unreadable]
-
- @options.check_files
- end
- ensure
- unreadable.close if unreadable
+ if RUBY_PLATFORM =~ /mswin|mingw/ then
+ @options.files = %w[nonexistent]
+
+ expected = <<-EXPECTED
+file 'nonexistent' not found
+ EXPECTED
+ else
+ FileUtils.touch 'unreadable'
+ FileUtils.chmod 0, 'unreadable'
+
+ @options.files = %w[nonexistent unreadable]
+
+ expected = <<-EXPECTED
+file 'nonexistent' not found
+file 'unreadable' not readable
+ EXPECTED
end
+
+ @options.check_files
end
end
@@ -45,11 +46,6 @@ class TestRDocOptions < MiniTest::Unit::TestCase
assert_equal '', out
- expected = <<-EXPECTED
-file 'nonexistent' not found
-file 'unreadable' not readable
- EXPECTED
-
assert_equal expected, err
end