     (with-out-file temp-out
       (bwa/index temp-fa-file (str temp-dir "/test3.fa") :is false)) => anything
     (with-out-file temp-out
-      (bwa/index temp-fa-file (str temp-dir "/test4.fa") :auto true)) => anything
-      ))
+      (bwa/index temp-fa-file (str temp-dir "/test4.fa") :auto true)) => anything))
+
+;; aln test
+;; --------
+
+(with-state-changes [(before :facts (do (prepare-cache!)
+                                        (doseq [f test-db-files]
+                                          (fs/copy f (str temp-dir "/" (fs/base-name f))))
+                                        (fs/copy test-fq-file (str temp-dir "/test.fq"))))
+                     (after :facts (clean-cache!))]
+  (fact "about aln"
+    (with-out-file temp-out
+      (bwa/aln (str temp-dir "/test.fa")
+               (str temp-dir "/test.fq")
+               (str temp-dir "/test.sai")
+               (bwa/aln-option))) => anything))

  `(binding [*out* (clojure.java.io/writer ~f)]
     ~@body))

(def temp-dir (.getPath (io/file (System/getProperty "java.io.tmpdir") "cljam-test")))

(defn prepare-cache!
  []

(ns clj-bwa.t-core
  "Tests for clj-bwa.core."
  (:require [midje.sweet :refer :all]
            [clojure.java.io :as io]
            [me.raynes.fs :as fs]
