Refactoring: Extract make_action into actions-test-lib.sh.

This reduces the duplication in the individual test files.
This commit is contained in:
Ingo Karkat
2012-04-27 12:42:10 +02:00
parent 42424d5881
commit 99e5e57a75
5 changed files with 22 additions and 51 deletions

View File

@@ -4,19 +4,9 @@ test_description='custom actions functionality
This test covers the contract between todo.sh and custom actions.
'
. ./actions-test-lib.sh
. ./test-lib.sh
unset TODO_ACTIONS_DIR
mkdir .todo.actions.d
make_action()
{
cat > ".todo.actions.d/$1" <<- EOF
#!/bin/bash
echo "custom action $1"
EOF
chmod +x ".todo.actions.d/$1"
}
make_action "foo"
test_todo_session 'executable action' <<EOF
>>> todo.sh foo