Black-box tests that run the script with stub commands on a minimal PATH and temp config/state folders.
9 lines
336 B
Bash
Executable File
9 lines
336 B
Bash
Executable File
#!/bin/bash
|
|
# Prints $STUB_DATA/checkupdates; exits $CHECKUPDATES_RC, else 0 with updates and 2 without, like the real one.
|
|
printf '%s %s\n' "${0##*/}" "$*" >> "$STUB_DATA/calls"
|
|
if [[ -s $STUB_DATA/checkupdates ]]; then
|
|
printf '%s\n' "$(<"$STUB_DATA/checkupdates")"
|
|
exit "${CHECKUPDATES_RC:-0}"
|
|
fi
|
|
exit "${CHECKUPDATES_RC:-2}"
|