Last active
April 21, 2019 12:45
-
-
Save MichaelDimmitt/94b843b17e7c1a3b2da1adc7fb48f855 to your computer and use it in GitHub Desktop.
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
cd ~ && | |
startingFolderLocation=$OLDPWD && | |
git clone https://github.com/bats-core/bats-core.git && | |
cd bats-core && | |
sudo ./install.sh /usr/local && | |
cd $startingFolderLocation && | |
mkdir bats_test_suite_example && | |
cd bats_test_suite_example && | |
echo ' | |
#!/usr/bin/env bats | |
@test "addition using bc" { | |
result="$(echo 2+2 | bc)" | |
[ "$result" -eq 4 ] | |
} | |
@test "addition using dc" { | |
result="$(echo 2 2+p | dc)" | |
[ "$result" -eq 4 ] | |
} | |
' >> addition.bats && | |
bats addition.bats | |
## If everything worked you just ran two tests with the bats test suite | |
## For more information read the official Readme: https://github.com/sstephenson/bats | |
## The above example comes from the official Readme with a few additions from myself to make it a oneliner. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment