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
|
module Cmdtest
|
||||||
|
|
||||||
|
ORIG_CWD = Dir.pwd
|
||||||
|
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
module LogBaseMixin
|
module LogBaseMixin
|
||||||
@ -183,6 +185,8 @@ module Cmdtest
|
|||||||
io.puts "BACKTRACE:"
|
io.puts "BACKTRACE:"
|
||||||
io.puts e.backtrace.map {|line| " " + line }
|
io.puts e.backtrace.map {|line| " " + line }
|
||||||
clog.assert_error(io.string)
|
clog.assert_error(io.string)
|
||||||
|
ensure
|
||||||
|
Dir.chdir(ORIG_CWD)
|
||||||
end
|
end
|
||||||
obj.teardown
|
obj.teardown
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user