 (ns codewars.runner
   (:require [codewars.runner :refer [run]]
+            [codewars.clojure.test]
             [clojure.java.io :as io]
             [codewars.util :refer [write-code!]])
   (:import [codewars.java TempDir]

  (let [dir (TempDir/create "java")
        setup (when (not (empty? setup)) (write-code! "java" dir setup))
        solution (write-code! "java" dir solution)
        files (file-names [setup solution])]
    (apply compile! files)
    (-> solution
        :class-name

        fixture (write-code! "java" dir fixture)
        setup (when (not (empty? setup)) (write-code! "java" dir setup))
        solution (write-code! "java" dir solution)
        files (file-names fixture setup solution)]
    (apply compile! files)
    (->> fixture :class-name (load-class dir) run-junit-tests)))
