Created
January 11, 2013 22:46
-
-
Save jaycfields/4514632 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn true-or-nil? [x] | |
(or (true? x) (nil? x))) | |
;; this test passes | |
(expect (interaction (spit #"/tmp/" String :append true-or-nil?)) | |
(do | |
(spit "/tmp/somewhere-else" "nil") | |
(spit "/tmp/hello-world" "some data" :append true))) | |
;; so does this test | |
(expect (interaction (spit #"/tmp/" String :append true-or-nil?)) | |
(do | |
(spit "/tmp/somewhere-else" "nil") | |
(spit "/tmp/hello-world" "some data" :append nil))) | |
;; this test fails | |
(expect (interaction (spit #"/tmp/" String :append true-or-nil?)) | |
(do | |
(spit "/tmp/somewhere-else" "nil") | |
(spit "/tmp/hello-world" "some data" :append "not true or nil"))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment