                                                (Thread.
                                                  (fn []
                                                    (binding [*out* tmp-out]
-                                                     (sleep 500)
+                                                     (utils/sleep 500)
                                                      (println "Finished."))))
                                                (.start)))
                                            "Started.")}}}
         test-cmd-input ["async-foo" "_sleep 1000"]
-        out-string (test-cli-stdout #(start-cli cli-opts) test-cmd-input)]
-    (is (= (expected-string ["Starting..." "\"Started.\"" "Finished."]) out-string))))
-
-
-
-(deftest print-cmd-invalid-token-to-string-fallback-test
+        out-string (cli-tests/test-cli-stdout #(cli/start-cli cli-opts) test-cmd-input)]
+    (test/is (= (cli-tests/expected-string ["Starting..." "\"Started.\"" "Finished."]) out-string))))
+
+
+
+(test/deftest print-cmd-invalid-token-to-string-fallback-test
   (let [cli-opts {:cmds {:print {:fn #(println %)}}}
         test-cmd-input ["print /foo/bar"]
-        out-string (test-cli-stdout #(start-cli cli-opts) test-cmd-input)]
-    (is (= (expected-string ["/foo/bar"]) out-string))))
-
-(deftest print-cmd-invalid-token-exception-test
+        out-string (cli-tests/test-cli-stdout #(cli/start-cli cli-opts) test-cmd-input)]
+    (test/is (= (cli-tests/expected-string ["/foo/bar"]) out-string))))
+
+(test/deftest print-cmd-invalid-token-exception-test
   (let [cli-opts {:cmds {:print {:fn #(println %)}}
                   :invalid-token-to-string false}
         test-cmd-input ["print /foo/bar"]
-        out-string (test-cli-stderr #(start-cli cli-opts) test-cmd-input)]
-    (is (.startsWith out-string "java.lang.RuntimeException: Invalid token: /foo/bar"))))
-
-
-
-(deftest enable-trace-test
+        out-string (cli-tests/test-cli-stderr #(cli/start-cli cli-opts) test-cmd-input)]
+    (test/is (.startsWith out-string "java.lang.RuntimeException: Invalid token: /foo/bar"))))
+
+
+
+(test/deftest enable-trace-test
   (let [cli-opts {}
         test-cmd-input ["_enable-trace true"]
-        out-string (test-cli-stdout #(start-cli cli-opts) test-cmd-input)]
-    (is (= (expected-string ["print-exception-trace is set to: true"]) out-string))))
-
-(deftest enable-trace-wrong-arg-test
+        out-string (cli-tests/test-cli-stdout #(cli/start-cli cli-opts) test-cmd-input)]
+    (test/is (= (cli-tests/expected-string ["print-exception-trace is set to: true"]) out-string))))
+
+(test/deftest enable-trace-wrong-arg-test
   (let [cli-opts {}
         test-cmd-input ["_enable-trace 123"]
-        out-string (test-cli-stdout #(start-cli cli-opts) test-cmd-input)]
-    (is (= (expected-string
+        out-string (cli-tests/test-cli-stdout #(cli/start-cli cli-opts) test-cmd-input)]
+    (test/is (= (cli-tests/expected-string
              ["Error, you need to supply a boolean value: true or false"
               "print-exception-trace is set to: false"])
            out-string))))
 
 
 
-(deftest simple-jline-input-stream-mock-test
-  (let [in-string (str "a 1" *cli4clj-line-sep* "b 2 3" *cli4clj-line-sep* "q" *cli4clj-line-sep*)
-        out (binding [*jline-input-stream* (ByteArrayInputStream. (.getBytes in-string))]
+(test/deftest simple-jline-input-stream-mock-test
+  (let [in-string (str "a 1" cli/*cli4clj-line-sep* "b 2 3" cli/*cli4clj-line-sep* "q" cli/*cli4clj-line-sep*)
+        out (binding [cli/*jline-input-stream* (ByteArrayInputStream. (.getBytes in-string))]
               (with-out-str
-                (start-cli {:cmds {:a {:fn (fn [arg] (inc arg))}
+                (cli/start-cli {:cmds {:a {:fn (fn [arg] (inc arg))}
                                    :b {:fn (fn [summand1 summand2] (+ summand1 summand2))}}})))]
-    (is (= (expected-string ["2" (str "5" *cli4clj-line-sep*)]) out))))
-
+    (test/is (= (cli-tests/expected-string ["2" (str "5" cli/*cli4clj-line-sep*)]) out))))
+

                                               (Thread.
                                                 (fn []
                                                   (binding [*out* tmp-out]
                                                     (sleep 500)
                                                     (println "Finished."))))
                                               (.start)))
                                           "Started.")}}}
        test-cmd-input ["async-foo"]
        out-string (test-cli-stdout #(start-cli cli-opts) test-cmd-input)]
    (is (= (expected-string ["Starting..." "\"Started.\""]) out-string))))

(deftest async-cmd-sleep-finished-test
  (let [cli-opts {:cmds {:async-foo {:fn (fn []
                                           (println "Starting...")
                                           (let [tmp-out *out*]

              :x :d}
        expected {:a [:b :c :foo]
                  :d [:x :y]}]
    (test/is (= expected (cli/get-cmd-aliases cmds)))))



(test/deftest get-args-info-simple-fns-test
  (let [result (cli/add-args-info-m {:cmds {:a {:fn (fn [arg] (inc arg))}
                                            :b {:fn (fn [summand1 summand2] (+ summand1 summand2))}}})]
    (test/is (= '[[arg]] (get-in result [:cmds :a :fn-args])))
    (test/is (= '[[summand1 summand2]] (get-in result [:cmds :b :fn-args])))))

(test/deftest get-args-info-simple-multi-arity-fn-test
  (let [result (cli/add-args-info-m {:cmds {:a {:fn (fn ([a] (inc a)) ([a b] (+ a b)) ([a b c] (+ a b c)))}}})]
    (test/is (= '[[a] [a b] [a b c]] (get-in result [:cmds :a :fn-args])))))

(defn test-fn-single-arity
  [summand1 summand2]
