Skip to content

Instantly share code, notes, and snippets.

@akanehara
Last active December 26, 2017 02:42
Show Gist options
  • Save akanehara/ad3322663497f135bbad to your computer and use it in GitHub Desktop.
Save akanehara/ad3322663497f135bbad to your computer and use it in GitHub Desktop.
shUnit2ずぼらスケルトン
#!/bin/sh
oneTimeSetUp()
{
echo oneTimeSetUp
}
oneTimeTearDown()
{
echo oneTimeTearDown
}
setUp()
{
echo setUp
}
tearDown()
{
echo tearDown
}
testFoo1()
{
assertEquals 1 1
assertNotEquals 1 2
assertNull ""
assertNotNull 1
local FOO="foo"
assertTrue '[ -n "$FOO" ]'
assertFalse '[ -z "$FOO" ]'
}
SHUNIT2_VERSION="2.1.6"
SHUNIT2="shunit2-${SHUNIT2_VERSION}"
if [ ! -e "./${SHUNIT2}" ]; then
[ ! -e "./${SHUNIT2}.tgz" ] && curl -s -O https://shunit2.googlecode.com/files/${SHUNIT2}.tgz
tar zxvf "./${SHUNIT2}.tgz"
fi
. "./${SHUNIT2}/src/shunit2"
# shUnit2 doc
# http://shunit2.googlecode.com/svn/trunk/source/2.1/doc/shunit2.html
# https://sites.google.com/site/paclearner/shunit2-documentation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment