fix broken 'import_file' when using t/ or test/ directory

This commit is contained in:
Johan Holmberg 2013-04-18 08:58:22 +02:00
parent 785629e86a
commit 5c58af597e
2 changed files with 7 additions and 3 deletions
bin
lib/cmdtest

@ -282,8 +282,8 @@ module Cmdtest
@orig_env_path.dup
end
def test_files_dir
@project_dir.test_files_dir
def test_files_top
@project_dir.test_files_top
end
def run(clog)
@ -341,6 +341,10 @@ module Cmdtest
File.expand_path(File.dirname(test_filenames[0]), ORIG_CWD)
end
def test_files_top
ORIG_CWD
end
private
def _fs_test_filenames

@ -103,7 +103,7 @@ module Cmdtest
# the current directory at the time of the call.
def import_file(src, tgt)
src_path = File.expand_path(src, @_runner.test_files_dir)
src_path = File.expand_path(src, @_runner.test_files_top)
tgt_path = _cwd_path(tgt)
FileUtils.mkdir_p(File.dirname(tgt_path))
FileUtils.cp(src_path, tgt_path)