test are somehow working

This commit is contained in:
jem 2021-02-19 18:41:51 +01:00
parent aad3844314
commit 0b01309b43
7 changed files with 51 additions and 16 deletions

View file

@ -6,13 +6,14 @@
:dependencies [[org.clojure/clojure "1.10.0"] :dependencies [[org.clojure/clojure "1.10.0"]
[aero "1.1.6"] [aero "1.1.6"]
[clj-commons/clj-yaml "0.7.106"]] [clj-commons/clj-yaml "0.7.106"]]
:source-paths ["src/main"] :source-paths ["src/main/cljc"
:resource-paths ["resources/main"] "src/main/clj"]
:resource-paths ["src/main/resources"]
:repositories [["snapshots" :clojars] :repositories [["snapshots" :clojars]
["releases" :clojars]] ["releases" :clojars]]
:deploy-repositories [["snapshots" :clojars] :deploy-repositories [["snapshots" :clojars]
["releases" :clojars]] ["releases" :clojars]]
:profiles {:test {:test-paths ["test/src"] :profiles {:test {:test-paths ["src/test/cljc"]
:resource-paths ["test/resources"] :resource-paths ["src/test/resources"]
:dependencies [[dda/data-test "0.1.1"]]}}) :dependencies [[dda/data-test "0.1.1"]]}})

View file

@ -1,8 +1,13 @@
{:source-paths ["src/main/" {:source-paths ["src/main/cljc"
"src/test"] "src/main/cljs"
"src/test/cljc"]
:dependencies [[aero "1.1.6"] :dependencies [[aero "1.1.6"]
[cljsjs/js-yaml "4.0.0-0"]] [cljsjs/js-yaml "4.0.0-0"]]
:builds {:app {:target :node-script :builds {:test {:target :node-test
:output-to "target/node-tests.js"
:autorun true
:repl-pprint true}
:app {:target :node-script
:output-to "target/k8s-mastodon-bot.js" :output-to "target/k8s-mastodon-bot.js"
:main dda.k8s-mastodon-bot.script/hallowelt :main dda.k8s-mastodon-bot.core/main
:compiler-options {:optimizations :simple}}}} :compiler-options {:optimizations :simple}}}}

View file

@ -0,0 +1,21 @@
(ns dda.k8s-mastodon-bot.core
(:require
[clojure.spec.alpha :as s]
[clojure.string :as cs]
;;[dda.k8s-mastodon-bot.yaml :as yaml]
))
(s/def ::options (s/* #{"-h"}))
(s/def ::config-location (s/? (s/and string?
#(not (cs/starts-with? % "-")))))
(s/def ::args (s/cat :options ::options
:config-location ::config-location))
(defn main [& args]
(let [parsed-args (s/conform ::args args)]
(if (= ::s/invalid parsed-args)
(do (s/explain ::args args)
)
(let [{:keys [options config-location]} parsed-args]
"hallowelt"
))))

View file

@ -0,0 +1,8 @@
(ns dda.k8s-mastodon-bot.yaml
(:require
[aero.core :as aero]
;;[jsyaml :as yaml]
))
(defn from-string [input]
42)

View file

@ -1,4 +0,0 @@
(ns dda.k8s-mastodon-bot.core)
(defn mytest[]
(println "fhasd"))

View file

@ -1,4 +0,0 @@
(ns dda.k8s-mastodon-bot.script)
(defn hallowelt []
42)

View file

@ -0,0 +1,8 @@
(ns dda.k8s-mastodon-bot.yaml-test
(:require
[clojure.test :refer [deftest is testing are]]
[dda.k8s-mastodon-bot.yaml :as cut]))
(deftest should-pars-yaml-string
(is (= 43
(cut/from-string "hallo: welt"))))