Add taskl function
This commit is contained in:
commit
1b62d00350
|
@ -0,0 +1,8 @@
|
|||
install:
|
||||
test -d ~/.local/bin/ || mkdir -p ~/.local/bin/
|
||||
cp generatetask ~/.local/bin/generatetask
|
||||
chmod +x ~/.local/bin/generatetask
|
||||
test:
|
||||
bash_unit tests/test*.sh
|
||||
testrunner:
|
||||
find generatetask tests/test*.sh | entr -c bash_unit tests/test*
|
|
@ -0,0 +1,12 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
taskl() {
|
||||
task \
|
||||
rc.verbose:nothing \
|
||||
rc.report.list.columns:id \
|
||||
rc.report.list.labels:id \
|
||||
"$@" \
|
||||
list
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
#!/bin/bash
|
||||
|
||||
setup() {
|
||||
source ../generatetask
|
||||
}
|
||||
|
||||
test_taskl_runs_task_with_correct_parameters() {
|
||||
fake task 'echo "task ${FAKE_PARAMS[@]}"'
|
||||
expected="task rc.verbose:nothing rc.report.list.columns:id rc.report.list.labels:id list"
|
||||
|
||||
result="$(taskl)"
|
||||
|
||||
assert_equals "$expected" "$result"
|
||||
}
|
||||
|
||||
test_taskl_runs_task_with_custom_parameters() {
|
||||
fake task 'echo "task ${FAKE_PARAMS[@]}"'
|
||||
expected="task rc.verbose:nothing rc.report.list.columns:id rc.report.list.labels:id +ACTIVE -BLOCKED list"
|
||||
|
||||
result="$(taskl +ACTIVE -BLOCKED)"
|
||||
|
||||
assert_equals "$expected" "$result"
|
||||
}
|
Loading…
Reference in New Issue