1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
usa 2011-02-07 01:23:28 +00:00
parent 28937bf81f
commit 55ea57af65
2 changed files with 22 additions and 20 deletions

View file

@ -1,3 +1,9 @@
Mon Feb 7 10:21:50 2011 NAKAMURA Usaku <usa@ruby-lang.org>
* 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.
Sun Feb 6 13:48:29 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/json/lib/json/common.rb (JSON::MissingUnicodeSupport.iconv):

View file

@ -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
if RUBY_PLATFORM =~ /mswin|mingw/ then
@options.files = %w[nonexistent]
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
expected = <<-EXPECTED
file 'nonexistent' not found
EXPECTED
else
FileUtils.touch 'unreadable'
FileUtils.chmod 0, 'unreadable'
@options.files = %w[nonexistent unreadable]
@options.files = %w[nonexistent unreadable]
@options.check_files
end
ensure
unreadable.close if 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