Browse files

[Issue #82] added one more validation case taking the opts-map into a…

…ccount
  • Loading branch information...
1 parent 5906a1d commit a0caf34d33ffb897a4d2bbac12be3b965956c5d5 @AlexBaranosky AlexBaranosky committed Mar 15, 2012
Showing with 6 additions and 7 deletions.
  1. +0 −2 FORMULAS-BACKLOG-AND-FEATURE-IDEAS.md
  2. +6 −5 test/midje/ideas/t_formulas.clj
View
2 FORMULAS-BACKLOG-AND-FEATURE-IDEAS.md
@@ -28,8 +28,6 @@
* [x] validate that opt-map is only used with valid keys.
* [x] validate that :num-trials is 1+
-
-* [ ] more formula syntax validation cases inspired by the new opt map
* [ ] Work with Meikel Brandmeyer to combine ClojureCheck's Generators with Shrink.
implement shrinking. Report only the first fully shrunken failure
View
11 test/midje/ideas/t_formulas.clj
@@ -13,7 +13,7 @@
(each-causes-validation-error #"There is no expection in your formula form"
(formula [a 1])
(formula [a 1] 1)
- (formula "vector fact" [a 1] (contains 3))
+ (formula "a doc string" [a 1] (contains 3))
(formula "ignores arrows in provideds" [a 1]
(contains 3)
@@ -38,12 +38,13 @@
(contains 3)))
(each-causes-validation-error #"Formula requires bindings to be an even numbered vector of 2 or more"
- (formula "vector fact" :not-vector 1 => 1)
- (formula "vector fact" [a 1 1] 1 => 1)
- (formula "vector fact" [] 1 => 1))
+ (formula "a doc string" :not-vector 1 => 1)
+ (formula "a doc string" [a 1 1] 1 => 1)
+ (formula "a doc string" [] 1 => 1)
+ (formula "a doc string" {:num-trials 50} 1 => 1))
(causes-validation-error #"There are too many expections in your formula form"
- (formula "vector fact" [a 1] a => 1 a => 1))
+ (formula "a doc string" [a 1] a => 1 a => 1))
(causes-validation-error #"Invalid keys \(:foo, :bar\) in formula's options map. Valid keys are: :num-trials"
(formula {:foo 5 :bar 6} [a 1] a => 1))

0 comments on commit a0caf34

Please sign in to comment.