Skip to content

Commit

Permalink
"added some basic tests testing the scaffolding"
Browse files Browse the repository at this point in the history
  • Loading branch information
Josee9988 committed Jul 8, 2021
1 parent 5304d60 commit 47a17ca
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions tests/project_scaffolding.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#! /bin/bash
# file: examples/arguments_test.sh

TESTS_TRASH_DIR="tests/.tests_trash"

cp -r * $TESTS_TRASH_DIR --copy-content 2>/dev/null || :
cp -r .github/ $TESTS_TRASH_DIR --copy-contents
cp -r bin/ $TESTS_TRASH_DIR --copy-contents
rm -r $TESTS_TRASH_DIR/tests/
rm -r $TESTS_TRASH_DIR/.git/ 2>/dev/null || :

#cd "tests/.tests_trash" || exit
# TESTS

suite() {
suite_addTest testDotGithubFolder
suite_addTest testDotGithubISSUE_TEMPLATE
suite_addTest testDotGithubISSUE_TEMPLATEFiles
suite_addTest testDotGithubFiles

}

testDotGithubFolder() {
githubFolderFound=0
if [ -e "$TESTS_TRASH_DIR/.github/" ]; then
githubFolderFound=1
fi
assertEquals 1 $githubFolderFound

}

testDotGithubISSUE_TEMPLATE() {
folderFound=0
if [ -e "$TESTS_TRASH_DIR/.github/ISSUE_TEMPLATE" ]; then
folderFound=1
fi
assertEquals 1 $folderFound
}

testDotGithubISSUE_TEMPLATEFiles() {
filesFound=0
if [ -e "$TESTS_TRASH_DIR/.github/ISSUE_TEMPLATE/1-bug-report.md" ] && [ -e "$TESTS_TRASH_DIR/.github/ISSUE_TEMPLATE/2-failing-test.md" ] && [ -e "$TESTS_TRASH_DIR/.github/ISSUE_TEMPLATE/3-docs-bug.md" ] && [ -e "$TESTS_TRASH_DIR/.github/ISSUE_TEMPLATE/4-feature-request.md" ] && [ -e "$TESTS_TRASH_DIR/.github/ISSUE_TEMPLATE/5-enhancement-request.md" ] && [ -e "$TESTS_TRASH_DIR/.github/ISSUE_TEMPLATE/6-security-report.md" ] && [ -e "$TESTS_TRASH_DIR/.github/ISSUE_TEMPLATE/7-question-support.md" ] && [ -e "$TESTS_TRASH_DIR/.github/ISSUE_TEMPLATE/config.yml" ]; then
filesFound=1
fi
assertEquals 1 $filesFound
}

testDotGithubFiles() {
filesFound=0
if [ -e "$TESTS_TRASH_DIR/.github/CODEOWNERS" ] && [ -e "$TESTS_TRASH_DIR/.github/CODE_OF_CONDUCT.md" ] && [ -e "$TESTS_TRASH_DIR/.github/CONTRIBUTING.md" ] && [ -e "$TESTS_TRASH_DIR/.github/ISSUE_TEMPLATE.md" ] && [ -e "$TESTS_TRASH_DIR/.github/pull_request_template.md" ] && [ -e "$TESTS_TRASH_DIR/.github/SECURITY.md" ] && [ -e "$TESTS_TRASH_DIR/.github/SUPPORT.md" ] && [ -e "$TESTS_TRASH_DIR/.github/issue_label_bot.yaml" ] && [ -e "$TESTS_TRASH_DIR/.github/config.yml" ] && [ -e "$TESTS_TRASH_DIR/.github/FUNDING.yml" ] && [ -e "$TESTS_TRASH_DIR/.github/settings.yml" ]; then
filesFound=1
fi
assertEquals 1 $filesFound
}

# Load and run shUnit2.
#cd "../.." || exit
. tests/shunit2

0 comments on commit 47a17ca

Please sign in to comment.