File tree Expand file tree Collapse file tree
test/net/lewisship/cli_tools Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2626(deftest simple-commands-work
2727 (is (match? {:status 0
2828 :out " simple: ok\n " }
29- (dispatch " simp" )))
30-
31- (is (match? {:status 0
32- :out " messy: kiwi ok\n " }
33- (dispatch " messy" " kiwi" ))))
29+ (dispatch " simp" ))))
3430
3531(deftest missing-positional-in-nested
3632 (is (match? {:status 1
4137 (is (match? {:out " nested: ok\n " }
4238 (dispatch " mess" " nest" ))))
4339
40+ (deftest matches-command-when-cant-find-sub-command
41+ (is (match? {:out " messy: kiwi ok\n " }
42+ (dispatch " mess" " kiwi" ))))
43+
4444(comment
4545
4646 (defn capture [f & args]
47- (let [{:keys [out err]} (binding [ansi/*color-enabled* false ]
48- (apply dispatch args))
47+ (let [{:keys [out err]} (apply dispatch args)
4948 captured (if (string/blank? out)
5049 err
5150 out)
5453 (println (str out-path " :" ))
5554 (print captured)))
5655
57- (dispatch " help" " --full" )
58-
5956 (capture " messy-full-help" " help" " --full" )
6057
6158 (capture " messy-simple" " simple" )
You can’t perform that action at this time.
0 commit comments