summaryrefslogtreecommitdiff
path: root/test/rdoc
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-12 07:08:06 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-12 07:08:06 +0000
commitb3f491d3cb55b06029edf790ccf26cb6be50e28a (patch)
tree0c98d98217d4ec0336f96d620d992364bacb9e64 /test/rdoc
parent3c4f8ce0921a5b64b77c5d6be69737f9dbf48d70 (diff)
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
Diffstat (limited to 'test/rdoc')
-rw-r--r--test/rdoc/test_rdoc_rdoc.rb11
1 files changed, 6 insertions, 5 deletions
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