Files
bin
doc
examples
lib
python
src
t
bin
00-assert.rb
00-exit_nonzero.rb
00-exit_status.rb
00-exit_zero.rb
00-file_equal.rb
00-file_not_equal.rb
00-ignore_file.rb
00-import_file.rb
00-stderr_equal.rb
00-stderr_not_equal.rb
00-stdout_equal.rb
00-stdout_not_equal.rb
01-cmd.rb
01-misc.rb
01-simple.rb
CMDTEST_assert.rb
CMDTEST_chdir.rb
CMDTEST_cmd.rb
CMDTEST_exit_nonzero.rb
CMDTEST_exit_status.rb
CMDTEST_exit_zero.rb
CMDTEST_file_equal.rb
CMDTEST_file_not_equal.rb
CMDTEST_ignore_file.rb
CMDTEST_import_file.rb
CMDTEST_misc.rb
CMDTEST_options.rb
CMDTEST_simple.rb
CMDTEST_stdxxx_equal.rb
CMDTEST_summary.rb
selftest_utils.rb
.hgignore
COPYING.txt
README.html
README.rst
Rakefile
file1.txt
file2.txt
run-regression.rb
setup.rb
cmdtest/t/CMDTEST_import_file.rb
2012-06-17 14:19:10 +02:00

63 lines
1.4 KiB
Ruby

require "selftest_utils"
class CMDTEST_import_file < Cmdtest::Testcase
include SelftestUtils
#----------------------------------------
# import_file
#----------------------------------------
def test_import_file_DIFFERENT_DIRS
create_file "file1.txt", "This is file1.txt\n"
create_file "file2.txt", "This is file2.txt\n"
create_CMDTEST_foo [
"import_file 'file1.txt', 'qwerty1.txt'",
"import_file 'file2.txt', 'subdir/qwerty2.txt'",
"",
"cmd 'cat.rb qwerty1.txt subdir/qwerty2.txt' do",
" stdout_equal [",
" 'This is file1.txt',",
" 'This is file2.txt',",
" ]",
"end",
]
cmd_cmdtest do
stdout_equal [
"### cat.rb qwerty1.txt subdir/qwerty2.txt",
]
end
end
#----------------------------------------
def test_import_file_AFTER_CHDIR
create_file "file1.txt", "This is file1.txt\n"
create_file "file2.txt", "This is file2.txt\n"
create_CMDTEST_foo [
"dir_mkdir('dir')",
"chdir('dir')",
"import_file 'file1.txt', 'qwerty1.txt'",
"import_file 'file2.txt', 'subdir/qwerty2.txt'",
"",
"cmd 'cat.rb qwerty1.txt subdir/qwerty2.txt' do",
" stdout_equal [",
" 'This is file1.txt',",
" 'This is file2.txt',",
" ]",
"end",
]
cmd_cmdtest do
stdout_equal [
"### cat.rb qwerty1.txt subdir/qwerty2.txt",
]
end
end
end