From dfc62b87175a679e0ca79884b227e9d1d42f1127 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Som=C4=93=20Cho?= Date: Fri, 4 Aug 2023 13:26:44 +0200 Subject: [PATCH] 0.4.37 - add dispatch test for add lein --- build.clj | 2 +- src/depo/core.clj | 2 +- test/depo/dispatch_test.clj | 18 +++++++++++++++++- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/build.clj b/build.clj index 9d0a5c7..36a199e 100644 --- a/build.clj +++ b/build.clj @@ -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") diff --git a/src/depo/core.clj b/src/depo/core.clj index 53a1b17..54add47 100644 --- a/src/depo/core.clj +++ b/src/depo/core.clj @@ -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" diff --git a/test/depo/dispatch_test.clj b/test/depo/dispatch_test.clj index 0995b5f..4539870 100644 --- a/test/depo/dispatch_test.clj +++ b/test/depo/dispatch_test.clj @@ -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" @@ -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")))))