Skip to content

Commit

Permalink
Add better test helper to user ns.
Browse files Browse the repository at this point in the history
  • Loading branch information
niwinz committed Feb 6, 2017
1 parent bbdd77a commit fb626a4
Showing 1 changed file with 12 additions and 16 deletions.
28 changes: 12 additions & 16 deletions src/user.clj
Expand Up @@ -6,20 +6,16 @@

;; --- Development Stuff

(defn test-vars
[& vars]
(repl/refresh)
(test/test-vars
(map (fn [sym]
(require (symbol (namespace sym)))
(resolve sym))
vars)))
(defn test
([] (test #"^datoteka.tests.*"))
([o]
(repl/refresh)
(cond
(instance? java.util.regex.Pattern o)
(test/run-all-tests o)

(defn test-ns
[ns]
(repl/refresh)
(test/test-ns ns))

(defn test-all
([] (test/run-all-tests #"^datoteka.tests.*"))
([re] (test/run-all-tests re)))
(symbol? o)
(if-let [sns (namespace o)]
(do (require (symbol sns))
(test/test-vars [(resolve o)]))
(test/test-ns o)))))

0 comments on commit fb626a4

Please sign in to comment.