I have a shell script that I would like to test with shUnit. The script (and all the functions) are in a single file since it makes installation much easier.
Example
If you are using Bash, another solution may be:
#!/bin/bash foo () { ... } bar () { ... } [[ "${FUNCNAME[0]}" == "source" ]] && return code