Refactoring: Extract make_action into actions-test-lib.sh.
This reduces the duplication in the individual test files.
This commit is contained in:
@@ -5,10 +5,9 @@ test_description='help functionality
|
||||
|
||||
This test covers the help output.
|
||||
'
|
||||
. ./actions-test-lib.sh
|
||||
. ./test-lib.sh
|
||||
|
||||
unset TODO_ACTIONS_DIR
|
||||
|
||||
# Note: To avoid having to adapt the test whenever the help documentation
|
||||
# slightly changes, only check for the section headers.
|
||||
test_todo_session 'help output' <<EOF
|
||||
@@ -33,16 +32,6 @@ test_todo_session 'very verbose help output' <<EOF
|
||||
Built-in Actions:
|
||||
EOF
|
||||
|
||||
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 'help output with custom action' <<EOF
|
||||
>>> todo.sh -v help | sed '/^ \w/!d'
|
||||
|
||||
Reference in New Issue
Block a user