Is alias supported in setUp?
gqqnbig opened this issue · comments
#!/bin/bash
oneTimeSetUp() {
alias hello='echo hello'
}
testMakeNewSale() {
hello
}
source shunit2
I run it by ./makeNewSaleTest.sh
. The error is
testMakeNewSale
./makeNewSaleTest.sh: line 14: hello: command not found
shunit2:ERROR testMakeNewSale() returned non-zero return code.Ran 1 test.
FAILED (failures=0)
Is alias supported in setUp/oneTimeSetUp?
shunit2 version is master (47be8b2).
alias
is not supported within shell scripts, only on the command-line.
An alternative solution to what you are trying might be:
#!/bin/bash
oneTimeSetUp() {
hello='echo hello'
}
testMakeNewSale() {
${hello} # hello is a variable, and its value must be retrieved as such.
}
source shunit2