Skip to content

Commit 4c8cb70

Browse files
hsbtaycabta
authored andcommitted
Remove and Restore the original HOME dir (#3057)
1 parent 458fec2 commit 4c8cb70

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/rdoc/support/test_case.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ class RDoc::TestCase < Test::Unit::TestCase
4949
def setup
5050
super
5151

52+
@orig_home = ENV["HOME"]
53+
ENV["HOME"] = Dir.tmpdir
54+
5255
@top_level = nil
5356

5457
@RM = RDoc::Markup
@@ -69,6 +72,15 @@ def g.file_dir() end
6972
RDoc::Markup::PreProcess.reset
7073
end
7174

75+
##
76+
# Abstract test-case teardown
77+
78+
def teardown
79+
ENV["HOME"] = @orig_home
80+
81+
super
82+
end
83+
7284
##
7385
# Asserts +path+ is a file
7486

0 commit comments

Comments
 (0)