From 5c58af597e0bf77f22e7ab61760432d1fb29a14c Mon Sep 17 00:00:00 2001 From: Johan Holmberg Date: Thu, 18 Apr 2013 08:58:22 +0200 Subject: [PATCH] fix broken 'import_file' when using t/ or test/ directory --- bin/cmdtest.rb | 8 ++++++-- lib/cmdtest/testcase.rb | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/bin/cmdtest.rb b/bin/cmdtest.rb index 56f2289..b93cbb7 100755 --- a/bin/cmdtest.rb +++ b/bin/cmdtest.rb @@ -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 diff --git a/lib/cmdtest/testcase.rb b/lib/cmdtest/testcase.rb index e506105..1516b11 100644 --- a/lib/cmdtest/testcase.rb +++ b/lib/cmdtest/testcase.rb @@ -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)