Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
BATS Example File
#!/usr/bin/env ../../..libs/bats/bin/bats
load '../../../lib/bats-support/load'
load '../../../lib/bats-assert/load'
# ^^ Make sure the above are correct, or make relative ^^
# Locate the script file to test based on .bats file path
SCRIPT_DIR="$BATS_TEST_DIRNAME"<relative_path_from_this_file>
TEST_PREFIX="download-image.sh -";
# Examples
# @test "$TEST_PREFIX should not.." {
# # function git() {
# # echo "abc/test-name";
# # }
# # export -f git
# run "$SCRIPT_DIR"/download-image.sh
# assert_failure
# }
# @test "$TEST_PREFIX should.." {
# # function git() {
# # echo "abc/test-name";
# # }
# # export -f git
# run "$SCRIPT_DIR"/download-image.sh
# assert_success
# }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment