Skip to content

Instantly share code, notes, and snippets.

@becca-bailey
Last active April 8, 2016 19:07
Show Gist options
  • Save becca-bailey/46c914d20887eba9d250a020c8a7860f to your computer and use it in GitHub Desktop.
Save becca-bailey/46c914d20887eba9d250a020c8a7860f to your computer and use it in GitHub Desktop.
Clojure.test example
(deftest returns-empty
(testing "Coin changer returns an empty collection if no cents are given"
(is (empty? (make-change 0)))))
(deftest returns-1-penny
(testing "Coin changer returns 1 penny if 1 cents are given"
(is (= [1] (make-change 1)))))
(deftest returns-2-pennies
(testing "Coin changer returns 2 pennies if 2 cents are given"
(is (= [1 1] (make-change 2)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment