| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
SCRIPT=./tap/jdg-tap-shellcheck |
| 4 |
SCRIPT_KO=./tap/jdg-tap-perlcritic |
| 5 |
FILE=./tests/fixtures/file-detection/test.sh |
| 6 |
NOT_PERL="File ./tests/fixtures/file-detection/test.sh doesn't look like perl [POSIX shell script, ASCII text executable]. Ignoring." |
| 7 |
FAKE_PATH=./tests/fixtures/file-detection/ |
| 8 |
|
| 9 |
PATH="${FAKE_PATH}:${PATH}" |
| 10 |
|
| 11 |
testOK() |
| 12 |
{ |
| 13 |
assertEquals "1..0" "$(PATH="${PATH}" $SCRIPT $FILE)" |
| 14 |
} |
| 15 |
|
| 16 |
testDetection() |
| 17 |
{ |
| 18 |
assertEquals "$NOT_PERL" "$(PATH="${PATH}" $SCRIPT_KO $FILE 2>&1)" |
| 19 |
} |
| 20 |
|
| 21 |
. /usr/share/shunit2/shunit2 |
| 22 |
|
| 23 |
# vim:foldmethod=marker ts=2 ft=sh ai expandtab sw=2 |