Show More
Commit Description:
Refactor.
Commit Description:
Refactor.
References:
File last commit:
Show/Diff file:
Action:
test/project_checkup/core_test.clj
52 lines | 1.8 KiB | text/x-clojure | ClojureLexer
52 lines | 1.8 KiB | text/x-clojure | ClojureLexer
r1 | (ns project-checkup.core-test | |||
(:require [clojure.test :refer :all] | ||||
[project-checkup.core :refer :all])) | ||||
r7 | (deftest test-check-vcs | |||
(testing "Ensure the check works." | ||||
(is | ||||
(check-vcs {:files [".git"]}) ) | ||||
(is | ||||
(check-vcs {:files [".hg"]}) ) | ||||
r30 | (is | |||
(check-vcs {:files [".hg" ".git"]}) )) | ||||
(testing "Ensure no false positives." | ||||
r7 | (is | |||
(not (check-vcs {:files []})) ) | ||||
(is ;various almost-correct entries | ||||
(not (check-vcs {:files ["hg" "git" "."]})) ))) | ||||
(deftest test-check-readme | ||||
(testing "Ensure READMEs are found correctly." | ||||
(is | ||||
(check-readme {:files ["README.md"]}))) | ||||
r30 | (testing "Ensure no false positives" | |||
(is | ||||
(not (check-readme {:files ["readme.exe"]}))) | ||||
r7 | (is | |||
(not (check-readme {:files []}))))) | ||||
(deftest test-check-untracked | ||||
(testing "Ensure empty returns true" | ||||
r30 | (is (check-untracked {:untracked-files []}))) | |||
r7 | (testing "Ensure non-empty returns false" | |||
(is (not (check-untracked {:untracked-files [".hg"]}))))) | ||||
r15 | (deftest test-check-license | |||
(testing "Ensure license is counted" | ||||
(is (check-license {:files ["LICENSE.mkd"]})) | ||||
(is (check-license {:files ["LICENSE"]}))) | ||||
(testing "Ensure non-plain text licenses don't count." | ||||
(is (not (check-license {:files ["LICENSE.docx"]}))) | ||||
(is (not (check-license {:files ["LICENSE.pdf"]})))) | ||||
(testing "Ensure blank is false." | ||||
(is (not (check-license {:files []}))) | ||||
(is (not (check-license {}))) | ||||
(is (not (check-license {:files ["licens" "README"]}))))) | ||||
r7 | (deftest test-get-extension | |||
(testing "test various paths with extensions" | ||||
(is (= (get-extension "test.txt") ".txt")) | ||||
(is (= (get-extension "./test.txt") ".txt")) | ||||
(is (= (get-extension "test.txt.bak") ".bak")) | ||||
r8 | (is (= (get-extension ".hg/test.txt.bak") ".bak")))) | |||