Skip to content

Instantly share code, notes, and snippets.

@jaycfields
Created January 11, 2013 22:46
Show Gist options
  • Save jaycfields/4514632 to your computer and use it in GitHub Desktop.
Save jaycfields/4514632 to your computer and use it in GitHub Desktop.
(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