Skip to content

Instantly share code, notes, and snippets.

@ghaskins
Created May 13, 2018 02:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ghaskins/57245da53b66b0ede4b1f745a17015e6 to your computer and use it in GitHub Desktop.
Save ghaskins/57245da53b66b0ede4b1f745a17015e6 to your computer and use it in GitHub Desktop.
(deftest compile-test
(testing "Generate and then compile our sample"
(let [{:keys [file]} (-> (io/resource "testdata/sample.request")
io/input-stream
main/decode-request
generate)
dir (io/file "target/test")]
;; Write the file(s) to our temp-dir
(doseq [{:keys [name content]} file]
(let [h (io/file dir name)
parent (.getParent h)]
(fs/mkdirs parent)
(spit h content)))
(pprint (namespace/find-clojure-sources-in-dir dir))
(require '[com.example.tutorial.sample :as sample] :reload :verbose)
(pprint com.example.tutorial.sample/pb->AddressBook))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment