-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: adds test case for list of commands (#56)
- Loading branch information
1 parent
0598ad2
commit 234d7cc
Showing
2 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
tests/integration/specs/multiple-commands-same-task-test.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/usr/bin/env bash | ||
source "$HELPERS" | ||
|
||
test "it a list of commands for the same task (on init)" | ||
|
||
echo " | ||
- name: run complex command | ||
run: ['echo first', 'echo second', 'echo complex | sed s/complex/third/g'] | ||
change: \"$WORKDIR/**\" | ||
run_on_init: true | ||
" > $WORKDIR/.oninit.yaml | ||
|
||
funzzy --config $WORKDIR/.oninit.yaml > $WORKDIR/output.txt & | ||
FUNZZY_PID=$! | ||
|
||
assert_file_contains "$WORKDIR/output.txt" "running: echo first" | ||
assert_file_contains "$WORKDIR/output.txt" "running: echo second" | ||
assert_file_contains "$WORKDIR/output.txt" "running: echo complex" | ||
assert_file_contains "$WORKDIR/output.txt" "third" | ||
assert_file_contains "$WORKDIR/output.txt" "Watching..." | ||
|
||
cleanup | ||
|
||
if [ -n "$CI" ]; then | ||
echo "Skipping test for CI" | ||
exit 0 | ||
fi | ||
|
||
test "it a list of commands for the same task (on change)" | ||
|
||
echo " | ||
- name: run complex command | ||
run: ['echo 100', 'echo 200', 'echo 4000 | sed s/4000/3333/g'] | ||
change: \"$WORKDIR/**\" | ||
" > $WORKDIR/.oninit.yaml | ||
|
||
funzzy --config $WORKDIR/.oninit.yaml > $WORKDIR/output.txt & | ||
FUNZZY_PID=$! | ||
|
||
assert_file_contains "$WORKDIR/output.txt" "Watching..." | ||
echo "test" >> $WORKDIR/test.txt | ||
sh -c "vi +%s/test/foo/g +wq $WORKDIR/test.txt -u NONE" | ||
assert_file_contains "$WORKDIR/output.txt" "running: echo 100" | ||
assert_file_contains "$WORKDIR/output.txt" "running: echo 200" | ||
assert_file_contains "$WORKDIR/output.txt" "running: echo 4000" | ||
assert_file_contains "$WORKDIR/output.txt" "3333" | ||
|
||
cleanup |