Meikel  Brandmeyer avatar Meikel Brandmeyer committed 25ea2e3

Let get-result and get-diagnostics act on an argument, no *the-harness*

Comments (0)

Files changed (2)

src/de/kotka/clojurecheck/harness.clj

   (dosync (commute (*the-harness* :current-test) inc)))
 
 (defmethod get-result ::Batch
-  []
+  [harness]
   (dosync
-    (and (or (= (deref (*the-harness* :our-plan)) :noplan)
-             (= (deref (*the-harness* :our-plan))
-                (deref (*the-harness* :current-test))))
-         (not (deref (*the-harness* :failed-test))))))
+    (and (or (= (deref (harness :our-plan)) :noplan)
+             (= (deref (harness :our-plan))
+                (deref (harness :current-test))))
+         (not (deref (harness :failed-test))))))
 
 (defmethod get-diagnostics ::Batch
-  []
-  (deref (*the-harness* :diagnostics)))
+  [harness]
+  (deref (harness :diagnostics)))
 
 (defvar *the-harness*
   (make-standard-harness)

src/de/kotka/clojurecheck/infrastructure.clj

   harness-dispatch)
 
 (defmulti
-  #^{:arglists '([])
+  #^{:arglists '([harness])
      :doc
-  "Retrieve the result of the tests run in the current harness. This
+  "Retrieve the result of the tests run in the given harness. This
   is not implemented for all harnesses."}
   get-result
-  harness-dispatch)
+  #(% :type))
 
 (defmulti
-  #^{:arglists '([])
+  #^{:arglists '([harness])
      :doc
-  "Retrieve the diagnostics of the tests run in the current harness.
+  "Retrieve the diagnostics of the tests run in the given harness.
   This is not implemented for all harnesses."}
   get-diagnostics
-  harness-dispatch)
+  #(% :type))
 
 (defn test-driver
   "Driver function for the tests. This function should only be called, when
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.