diff --git a/ChangeLog b/ChangeLog index 90836e280e..bc288482b2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed Dec 12 16:08:04 2012 Nobuyoshi Nakada + + * 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 * method.h (rb_method_flag_t): name a magic number for NOEX_SAFE and 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