Skip to content

Commit

Permalink
[Issue #82] arrows in against-background in a formula are ignored whe…
Browse files Browse the repository at this point in the history
…n looking for check arrows
  • Loading branch information
AlexBaranosky committed Mar 13, 2012
1 parent 3fac4a0 commit f8abb7c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion FORMULAS-BACKLOG-AND-FEATURE-IDEAS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* [x] don't run more tests than need be if there is already failure in this formula's batch.

* [x] syntax validate thata formula only has one check in it
a. [ ] need to make this more thorough... right now the only test oft his feature checks a
a. [ ] need to make this more thorough... right now the only test of this feature checks a
simple provided case, but needs to work with against-background, background and
other more interesting cases

Expand Down
2 changes: 1 addition & 1 deletion src/midje/ideas/formulas.clj
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
~conclusion-signal)))))

(defn- check-part-of [form]
(take-while #(not (and (named? %) (= "provided" (name %))))
(take-while #(not (and (named? %) (#{"provided" "against-background"} (name %))))
(flatten form)))

(defmethod validate "formula" [[_formula_ & args :as form]]
Expand Down
15 changes: 13 additions & 2 deletions test/midje/ideas/t_formulas.clj
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,19 @@
(formula [a 1] 1)
(formula "vector fact" [a 1] (contains 3))
(formula "vector fact" [a 1] (contains 3))
(formula "vector fact" [a 1] (contains 3)
(provided (h anything) => 5)))

(formula "vector fact" [a 1]
(contains 3)
(provided (h anything) => 5))

(formula "vector fact" [a 1]
(contains 3)
(against-background (h anything) => 5))

; (formula "vector fact" [a 1]
; (against-background (h anything) => 5)
; (contains 3))
)

(causes-validation-error #"There are too many expections in your formula form"
(formula "vector fact" [a 1] a => 1 a => 1))
Expand Down

0 comments on commit f8abb7c

Please sign in to comment.