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

test_rdoc_rdoc.rb: use File::NULL

* test/rdoc/test_rdoc_rdoc.rb (TestRDocRDoc#test_normalized_file_list_non_file_directory):
  use File::NULL for portability if possible.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38341 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2012-12-12 07:08:06 +00:00
parent 3c4f8ce092
commit b3f491d3cb
2 changed files with 11 additions and 5 deletions

View file

@ -1,3 +1,8 @@
Wed Dec 12 16:08:04 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
* test/rdoc/test_rdoc_rdoc.rb (TestRDocRDoc#test_normalized_file_list_non_file_directory):
use File::NULL for portability if possible.
Wed Dec 12 16:07:23 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
* method.h (rb_method_flag_t): name a magic number for NOEX_SAFE and

View file

@ -123,13 +123,14 @@ class TestRDocRDoc < RDoc::TestCase
end
def test_normalized_file_list_non_file_directory
skip '/dev/stdin is not a character special' unless
File.chardev? '/dev/stdin'
dev = defined?(File::NULL) ? File::NULL : '/dev/stdin'
skip "#{dev} is not a character special" unless
File.chardev? dev
files = nil
out, err = verbose_capture_io do
files = @rdoc.normalized_file_list %w[/dev/stdin]
files = @rdoc.normalized_file_list [dev]
end
files = files.map { |file| File.expand_path file }
@ -137,8 +138,8 @@ class TestRDocRDoc < RDoc::TestCase
assert_empty files
assert_empty out
assert_match %r%^rdoc can't parse%, err
assert_match %r%/dev/stdin$%, err
assert_match %r"^rdoc can't parse", err
assert_match %r"#{dev}$", err
end
def test_parse_file