Created
January 27, 2021 03:03
-
-
Save devlinjunker/c02db8e10c7017b493bb75b767739746 to your computer and use it in GitHub Desktop.
BATS Example File
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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