Skip to content

Commit

Permalink
0.4.37 - add dispatch test for add lein
Browse files Browse the repository at this point in the history
  • Loading branch information
somecho committed Aug 4, 2023
1 parent ab2fa4f commit dfc62b8
Show file tree
Hide file tree
Showing 3 changed files with 19 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.36")
(def version "0.4.37")
(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.36"
:version "0.4.37"
:opts [{:as "path to configuration file"
:default nil
:option "file"
Expand Down
18 changes: 17 additions & 1 deletion test/depo/dispatch_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
[clojure.test :refer [deftest testing is]]))

(def DEFAULT-PATH "test/resources/input/deps.edn")
(def LEIN-PATH "test/resources/input/project.clj")

(deftest add-default
(testing "add reagent 1.2.0"
Expand Down Expand Up @@ -50,4 +51,19 @@
z/root-string)]
(is (= new-deps (slurp DEFAULT-PATH))))))


(deftest add-lein
(testing "add reagent 1.2.0"
(let [procedure (create-procedure {:config-path LEIN-PATH
:id "reagent@1.2.0"
: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 (contains? new-deps 'reagent))
(is (= (get new-deps 'reagent) "1.2.0")))))

0 comments on commit dfc62b8

Please sign in to comment.