Skip to content

Commit

Permalink
dude
Browse files Browse the repository at this point in the history
  • Loading branch information
borkdude committed Jan 4, 2024
1 parent 280ee9f commit 7619262
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions test/babashka/cli_test.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,8 @@

(testing "spec can be overriden"
(d/deflet
(def table [{:cmds ["foo" "bar"] :fn identity :spec {:version {:coerce :string}}}
(def table [{:cmds ["foo" "bar"] :fn identity :spec {:version {:coerce :string}
}}
{:cmds ["foo"] :fn identity :spec {:version {:coerce :boolean}
:dude {:coerce :boolean}}}])
(is (submap? {:opts {:version true}, :args ["2010"]}
Expand All @@ -376,7 +377,16 @@
(-> (cli/dispatch
table
["foo" "--dude" "bar" "--version" "2010"])
:opts))))))
:opts)))
(testing "specific spec replaces less specific spec (no merge)"
(is (= {:dude "some-value"}
(-> (cli/dispatch
table
["foo" "bar" "--dude" "some-value"])
:opts))))))
;; TODO: args->opts conflinct with subcommand
;; TODO: more specific specs should not be merged, but overwritten
)

(deftest table->tree-test
(testing "internal represenation"
Expand Down

0 comments on commit 7619262

Please sign in to comment.