chdir to ORIG_CWD after each test method
so current directory is outside the temporary tree when it is cleaned between test methods.
This commit is contained in:
@ -47,6 +47,8 @@ require "stringio"
|
||||
|
||||
module Cmdtest
|
||||
|
||||
ORIG_CWD = Dir.pwd
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
module LogBaseMixin
|
||||
@ -183,6 +185,8 @@ module Cmdtest
|
||||
io.puts "BACKTRACE:"
|
||||
io.puts e.backtrace.map {|line| " " + line }
|
||||
clog.assert_error(io.string)
|
||||
ensure
|
||||
Dir.chdir(ORIG_CWD)
|
||||
end
|
||||
obj.teardown
|
||||
end
|
||||
|
Reference in New Issue
Block a user