From b3f491d3cb55b06029edf790ccf26cb6be50e28a Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 12 Dec 2012 07:08:06 +0000 Subject: 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 --- test/rdoc/test_rdoc_rdoc.rb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'test') diff --git a/test/rdoc/test_rdoc_rdoc.rb b/test/rdoc/test_rdoc_rdoc.rb index e29363a47a..25d8889ceb 100644 --- a/test/rdoc/test_rdoc_rdoc.rb +++ b/test/rdoc/test_rdoc_rdoc.rb @@ -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 -- cgit v1.2.3