Skip to content

Commit

Permalink
Fix problems with lingering temp dirs.
Browse files Browse the repository at this point in the history
* Use system-level temp location from Dir.mktmpdir.
* Use FileUtils.rm_rf to delete directory in teardown.

See #1987.
  • Loading branch information
headius committed Nov 2, 2016
1 parent b0abc53 commit d17628a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/jruby/test_tempfile_cleanup.rb
Expand Up @@ -6,13 +6,13 @@
class TestTempfilesCleanUp < Test::Unit::TestCase

def setup
@tmpdir = "tmp_#{$$}"
@tmpdir = Dir.mktmpdir(File.basename(__FILE__) + $$.to_s)
FileUtils.rm_f @tmpdir rescue nil
Dir.mkdir @tmpdir rescue nil
end

def teardown
FileUtils.rm_f @tmpdir
FileUtils.rm_rf @tmpdir
end

def test_cleanup
Expand Down

0 comments on commit d17628a

Please sign in to comment.