Skip to content

Commit

Permalink
0.4.38 - add dispatch tests for lein
Browse files Browse the repository at this point in the history
  • Loading branch information
somecho committed Aug 4, 2023
1 parent dfc62b8 commit 75061ae
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.clj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[deps-deploy.deps-deploy :as dd]))

(def lib 'org.clojars.some/depo)
(def version "0.4.37")
(def version "0.4.38")
(def jar-file (format "target/%s-%s.jar" (name lib) version))
(def class-dir "target/classes")
(def url "https://github.com/somecho/depo")
Expand Down
2 changes: 1 addition & 1 deletion src/depo/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
(def CONFIGURATION
{:command "depo"
:description "Manage dependencies for Clojure projects easily"
:version "0.4.37"
:version "0.4.38"
:opts [{:as "path to configuration file"
:default nil
:option "file"
Expand Down
40 changes: 39 additions & 1 deletion test/depo/dispatch_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,42 @@
read-string
(as-> v (into (sorted-map) v)))]
(is (contains? new-deps 'reagent))
(is (= (get new-deps 'reagent) "1.2.0")))))
(is (= (get new-deps 'reagent) "1.2.0"))))
(testing "add non-existent dependency"
(let [procedure (create-procedure {:config-path LEIN-PATH
:id "idonotexist/idonotexist"
:operation :add})
new-deps (-> procedure
dispatch
z/root-string
z/of-string
(z/find-value z/next :dependencies)
z/next
z/string
read-string
(as-> v (into (sorted-map) v)))]
(is (false? (contains? new-deps 'idonotexist))))))

(deftest remove-lein
(testing "remove slingshot"
(let [procedure (create-procedure {:config-path LEIN-PATH
:id "slingshot"
:operation :remove})
new-deps (-> procedure
dispatch
z/root-string
z/of-string
(z/find-value z/next :dependencies)
z/next
z/string
read-string
(as-> v (into (sorted-map) v)))]
(is (false? (contains? new-deps 'selmer)))))
(testing "remove non-existent dependency"
(let [procedure (create-procedure {:config-path LEIN-PATH
:id "idonotexist/idonotexist"
:operation :remove})
new-deps (-> procedure
dispatch
z/root-string)]
(is (= new-deps (slurp LEIN-PATH))))))

0 comments on commit 75061ae

Please sign in to comment.