Created
March 10, 2024 13:43
-
-
Save unclebob/8883540e8b5afb17e4c105203a83b92d to your computer and use it in GitHub Desktop.
newclj -- a simple tool to prepare a clojure project using speclj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
echo "making speclj project $1." | |
mkdir $1 | |
cd $1 | |
mkdir src | |
mkdir spec | |
cat >deps.edn << EOF | |
{:paths ["src" "resources"] | |
:deps {org.clojure/clojure {:mvn/version "1.11.1"} | |
speclj/speclj {:mvn/version "3.4.5"}} | |
:aliases | |
{:spec {:main-opts ["-m" "speclj.main" "-c"] | |
:extra-deps {speclj/speclj {:mvn/version "3.4.5"}} | |
:extra-paths ["spec"]}} | |
} | |
EOF | |
cat >src/$1.clj << EOF | |
(ns $1) | |
EOF | |
cat >spec/$1_spec.clj << EOF | |
(ns $1-spec | |
(:require [speclj.core :refer :all] | |
[$1 :refer :all])) | |
(describe "$1" | |
(it "needs writing" | |
(should false))) | |
EOF | |
echo "Done. Start tests with clj -M:spec <opts>" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment