Commits

Miki Tebeka  committed 1849916

Handle java.io.File parameters (issue #8)

  • Participants
  • Parent commits 020a4c9

Comments (0)

Files changed (2)

 (declare join)
 (defn- as-file [path]
   (cond
+    (instance? File path) path
     (= path "") (io/as-file "")
     (= path ".") (io/as-file *cwd*)
     (= (.substring path 0 1) *separator*) (io/as-file path)

File test/fs_test.clj

 (ns fs-test
+  (:import java.io.File)
   (:use [fs] :reload-all)
   (:use [clojure.test]))
 
     (is (= (cwd) "/tmp")))
   (is (= (cwd) *cwd*)))
 
+(deftest test-file
+  ; Test that we work with java.io.File objects as well
+  (is (directory? (File. "/tmp"))))