aboutsummaryrefslogtreecommitdiffstats
path: root/test/rdoc/test_rdoc_rdoc.rb
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-09-05 01:41:25 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-09-05 01:41:25 +0000
commitd42d6e690e3f553b971322eae783ac6b0d4d9692 (patch)
tree2004bf4517ee7b81466c300cf30092e62e65467e /test/rdoc/test_rdoc_rdoc.rb
parent670c6e8ce9d4a12bb4832e10fab27365398649bf (diff)
downloadruby-d42d6e690e3f553b971322eae783ac6b0d4d9692.tar.gz
* lib/rdoc.rb, lib/rdoc, test/rdoc: Update to RDoc 4.2.0.alpha(313287)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47391 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rdoc/test_rdoc_rdoc.rb')
-rw-r--r--test/rdoc/test_rdoc_rdoc.rb27
1 files changed, 24 insertions, 3 deletions
diff --git a/test/rdoc/test_rdoc_rdoc.rb b/test/rdoc/test_rdoc_rdoc.rb
index 8b349a4389..2adfdcc460 100644
--- a/test/rdoc/test_rdoc_rdoc.rb
+++ b/test/rdoc/test_rdoc_rdoc.rb
@@ -252,14 +252,16 @@ class TestRDocRDoc < RDoc::TestCase
@rdoc.options.encoding = Encoding::ISO_8859_1
@rdoc.store = RDoc::Store.new
- Tempfile.create 'test.txt' do |io|
+ tf = Tempfile.open 'test.txt' do |io|
io.write 'hi'
io.rewind
top_level = @rdoc.parse_file io.path
assert_equal Encoding::ISO_8859_1, top_level.absolute_name.encoding
+ io
end
+ tf.close! if tf.respond_to? :close?
end
def test_parse_file_forbidden
@@ -267,7 +269,7 @@ class TestRDocRDoc < RDoc::TestCase
@rdoc.store = RDoc::Store.new
- Tempfile.create 'test.txt' do |io|
+ tf = Tempfile.open 'test.txt' do |io|
io.write 'hi'
io.rewind
@@ -286,7 +288,9 @@ class TestRDocRDoc < RDoc::TestCase
ensure
File.chmod 0400, io.path
end
+ io
end
+ tf.close! if tf.respond_to? :close!
end
def test_remove_unparseable
@@ -382,7 +386,7 @@ class TestRDocRDoc < RDoc::TestCase
end
def test_setup_output_dir_exists_file
- Tempfile.create 'test_rdoc_rdoc' do |tempfile|
+ tf = Tempfile.open 'test_rdoc_rdoc' do |tempfile|
path = tempfile.path
e = assert_raises RDoc::Error do
@@ -391,7 +395,9 @@ class TestRDocRDoc < RDoc::TestCase
assert_match(%r%#{Regexp.escape path} exists and is not a directory%,
e.message)
+ tempfile
end
+ tf.close! if tf.respond_to? :close!
end
def test_setup_output_dir_exists_not_rdoc
@@ -430,5 +436,20 @@ class TestRDocRDoc < RDoc::TestCase
end
end
+ def test_normalized_file_list_removes_created_rid_dir
+ temp_dir do |d|
+ FileUtils.mkdir "doc"
+ flag_file = @rdoc.output_flag_file "doc"
+ file = File.join "doc", "test"
+ FileUtils.touch flag_file
+ FileUtils.touch file
+
+ file_list = ["doc"]
+
+ output = @rdoc.normalized_file_list file_list
+
+ assert_empty output
+ end
+ end
end