summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--test/rdoc/test_rdoc_rdoc.rb11
2 files changed, 11 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 90836e2..bc28848 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
diff --git a/test/rdoc/test_rdoc_rdoc.rb b/test/rdoc/test_rdoc_rdoc.rb
index e29363a..25d8889 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