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:
Johan Holmberg
2016-06-03 20:02:08 +02:00
parent 9117bc2e60
commit 3ea3d852aa

@ -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