Permalink
Browse files

A bit 'o documentation

  • Loading branch information...
1 parent 43985f3 commit f1476ea00cb8f7c3e38e8cf388ada425caa7ffa5 @marick committed Jan 28, 2013
Showing with 10 additions and 4 deletions.
  1. +10 −4 src/midje/checking/core.clj
@@ -5,13 +5,17 @@
;;; There is a notion of "extended falsehood", in which a false value may be a
;;; map containing information about what went wrong.
-(defn as-data-laden-falsehood [value]
- (vary-meta value assoc :midje/data-laden-falsehood true))
-
(defn data-laden-falsehood? [value]
(:midje/data-laden-falsehood (meta value)))
-(defn data-laden-falsehood-to-map [value]
+(defn as-data-laden-falsehood [value]
+ (vary-meta value assoc :midje/data-laden-falsehood true))
+
+(defn data-laden-falsehood-to-map
+ "Used for testing Midje itself, this prevents a Midje
+ example of the expected creation of a data-laden falsehood
+ from being interpreted as a failure."
+ [value]
(with-meta value {}))
(defn extended-false? [value]
@@ -22,6 +26,8 @@
(not (extended-false? value)))
(defn user-friendly-falsehood [value]
+ "'downcast' a possible data-laden falsehood into
+ `false` if necessary."
(if (data-laden-falsehood? value)
false
value))

0 comments on commit f1476ea

Please sign in to comment.