Skip to content

Instantly share code, notes, and snippets.

@devlinjunker
Created January 27, 2021 03:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devlinjunker/c02db8e10c7017b493bb75b767739746 to your computer and use it in GitHub Desktop.
Save devlinjunker/c02db8e10c7017b493bb75b767739746 to your computer and use it in GitHub Desktop.
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