chdir calls Dir.chdir when not parallel

This commit is contained in:
Johan Holmberg
2015-05-26 20:49:42 +02:00
parent 73249f5fd5
commit 7ff1b8c330

@ -212,13 +212,16 @@ module Cmdtest
if block_given?
saved_cwd = @_cwd
@_cwd = dir_path
Dir.chdir(@_cwd) if @_runner.opts.parallel == 1
begin
yield
ensure
@_cwd = saved_cwd
Dir.chdir(@_cwd) if @_runner.opts.parallel == 1
end
else
@_cwd = dir_path
Dir.chdir(@_cwd) if @_runner.opts.parallel == 1
end
end