Skip to content

Commit

Permalink
"finished project scaffolding"
Browse files Browse the repository at this point in the history
  • Loading branch information
Josee9988 committed Jul 8, 2021
1 parent e911304 commit b385d94
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/TESTS_RUNNER.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
28 changes: 27 additions & 1 deletion tests/project_scaffolding_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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

0 comments on commit b385d94

Please sign in to comment.