Created
April 23, 2013 16:41
-
-
Save fnichol/5445260 to your computer and use it in GitHub Desktop.
Test Kitchen with bats - A Lightning Guide
This file contains hidden or 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
SUITE_NAME=default | |
# create a bats subdirectory under your desired suite | |
mkdir -p test/integration/$SUITE_NAME/bats | |
# create an initial "canary" bats test file | |
# more examples at: | |
# * https://github.com/fnichol/chef-rvm/tree/master/test/integration/rubies/bats | |
# * https://github.com/fnichol/chef-ruby_build/tree/master/test/integration/alltherubies/bats | |
# * https://github.com/sstephenson/bats | |
cat <<'_EOF_' > test/integration/$SUITE_NAME/bats/sanity.bats | |
@test "gives me a /tmp directory" { | |
[ -d /tmp ] | |
} | |
_EOF_ | |
# run the suite | |
kitchen verify ${SUITE_NAME}- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks.
That allowed me to write initial tests for the sysctl cookbook.