Skip to content

Commit

Permalink
Introduce assert-in.
Browse files Browse the repository at this point in the history
  • Loading branch information
mmcgrana committed Dec 25, 2009
1 parent 3a91843 commit f1f390a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/clj_unit/core_assertions.clj
Expand Up @@ -30,6 +30,13 @@
(< actual (+ expected delta)))
(format "Expected %s +-%s, got %s" expected delta actual)))

(defn assert-in
"Assert that a value is one of given set."
[expected-from actual]
(assert-truth (contains? expected-from actual)
(format "Expected one of %s, got %s"
(pr-str expected-from) (pr-str actual))))

(defn assert-that
"Assert that a value is logically true - i.e. not nil or false."
[val]
Expand Down

0 comments on commit f1f390a

Please sign in to comment.