aboutsummaryrefslogtreecommitdiffstats
path: root/test/rdoc/test_rdoc_rdoc.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/rdoc/test_rdoc_rdoc.rb')
-rw-r--r--test/rdoc/test_rdoc_rdoc.rb12
1 files changed, 9 insertions, 3 deletions
diff --git a/test/rdoc/test_rdoc_rdoc.rb b/test/rdoc/test_rdoc_rdoc.rb
index 782409987a..f2cc901283 100644
--- a/test/rdoc/test_rdoc_rdoc.rb
+++ b/test/rdoc/test_rdoc_rdoc.rb
@@ -342,14 +342,16 @@ class TestRDocRDoc < RDoc::TestCase
@rdoc.options.encoding = Encoding::ISO_8859_1
@rdoc.store = RDoc::Store.new
- Tempfile.open '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!
end
def test_parse_file_forbidden
@@ -358,7 +360,7 @@ class TestRDocRDoc < RDoc::TestCase
@rdoc.store = RDoc::Store.new
- Tempfile.open 'test.txt' do |io|
+ tf = Tempfile.open 'test.txt' do |io|
io.write 'hi'
io.rewind
@@ -377,7 +379,9 @@ class TestRDocRDoc < RDoc::TestCase
ensure
File.chmod 0400, io.path
end
+ io
end
+ tf.close!
end
def test_remove_unparseable
@@ -474,7 +478,7 @@ class TestRDocRDoc < RDoc::TestCase
end
def test_setup_output_dir_exists_file
- Tempfile.open 'test_rdoc_rdoc' do |tempfile|
+ tf = Tempfile.open 'test_rdoc_rdoc' do |tempfile|
path = tempfile.path
e = assert_raise RDoc::Error do
@@ -483,7 +487,9 @@ class TestRDocRDoc < RDoc::TestCase
assert_match(%r%#{Regexp.escape path} exists and is not a directory%,
e.message)
+ tempfile
end
+ tf.close!
end
def test_setup_output_dir_exists_not_rdoc