Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
borkdude committed Jan 4, 2024
1 parent c970a4d commit 153f88e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions test/babashka/cli_test.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -385,8 +385,16 @@
(-> (cli/dispatch
table
["foo" "bar" "--dude" "some-value"])
:opts))))

:opts)))
(testing "even if the more specific spec doesn't have a spec at all"
(d/deflet
(def table [{:cmds ["foo"] :fn identity
:spec {:version {:coerce :boolean}}}
{:cmds ["foo" "bar"]
:fn identity}])
(is (submap?
{:dispatch ["foo" "bar"], :opts {:version "dude"}}
(cli/dispatch table ["foo" "bar" "--version" "dude"]))))))
(def table [{:cmds ["foo"] :fn identity
:spec {:version {:coerce :boolean}}
:args->opts [:some-option]}
Expand Down

0 comments on commit 153f88e

Please sign in to comment.