diff --git a/test/CMDTEST_vimdir.rb b/test/CMDTEST_vimdir.rb index 55ae526..84a854c 100644 --- a/test/CMDTEST_vimdir.rb +++ b/test/CMDTEST_vimdir.rb @@ -57,6 +57,16 @@ class CMDTEST_basic < Cmdtest::Testcase created_files ["output.txt"] end end + + def test_editor_fail + import_file "test/faulty_editor.sh", "./" + + cmd "EDITOR=./faulty_editor.sh vimdir -n ./" do + exit_nonzero + created_files ["vimdir_test_file.vimdir"] + stderr_equal /\A.*error.+\n.*notice.+\n/ + end + end end diff --git a/test/faulty_editor.sh b/test/faulty_editor.sh new file mode 100755 index 0000000..71d5e79 --- /dev/null +++ b/test/faulty_editor.sh @@ -0,0 +1,2 @@ +#!/bin/sh +exit 17