diff --git a/tests/TESTS_RUNNER.sh b/tests/TESTS_RUNNER.sh index 7e680b4..31e3771 100755 --- a/tests/TESTS_RUNNER.sh +++ b/tests/TESTS_RUNNER.sh @@ -8,7 +8,7 @@ declare -a files=("tests/project_scaffolding_test.sh" "tests/custom_data_test.sh center() { term_width="$(tput cols)" padding="$(printf '%0.1s' +{1..500})" - echo -e "\n\n${LGREEN}$(printf '%*.*s %s %*.*s\n' 0 "$(((term_width - 2 - ${#1}) / 2))" "$padding" "$1" 0 "$(((term_width - 1 - ${#1}) / 2))" "$padding")${NC}\n" + echo -e "\n${LGREEN}$(printf '%*.*s %s %*.*s\n' 0 "$(((term_width - 2 - ${#1}) / 2))" "$padding" "$1" 0 "$(((term_width - 1 - ${#1}) / 2))" "$padding")${NC}" } for file in "${files[@]}"; do diff --git a/tests/project_scaffolding_test.sh b/tests/project_scaffolding_test.sh index b4dad54..2e1526b 100755 --- a/tests/project_scaffolding_test.sh +++ b/tests/project_scaffolding_test.sh @@ -24,11 +24,13 @@ oneTimeTearDown() { # TESTS suite() { - suite_addTest testDotGithubFolder suite_addTest testDotGithubISSUE_TEMPLATE suite_addTest testDotGithubISSUE_TEMPLATEFiles suite_addTest testDotGithubFiles + suite_addTest testTestRemovedFiles + suite_addTest testGlobalFiles + suite_addTest testRemovedFiles } testDotGithubFolder() { @@ -64,5 +66,29 @@ testDotGithubFiles() { assertEquals 1 $filesFound } +testTestRemovedFiles() { + filesFound=0 + if [ -e "tests/" ] && [ -e "tests/shunit2" ] && [ -e "tests/TESTS_RUNNER.sh" ]; then + filesFound=1 + fi + assertNotEquals 1 $filesFound +} + +testGlobalFiles() { + filesFound=0 + if [ -e ".gitignore" ] && [ -e "CHANGELOG.md" ] && [ -e "README.md" ]; then + filesFound=1 + fi + assertEquals 1 $filesFound +} + +testRemovedFiles() { + filesFound=0 + if [ -e "LICENSE" ] && [ -e "bin" ] && [ -e "bin/FUNCTION_HELPERS.sh" ]; then + filesFound=1 + fi + assertNotEquals 1 $filesFound +} + # Load and run shUnit2. . tests/shunit2