From a0caf34d33ffb897a4d2bbac12be3b965956c5d5 Mon Sep 17 00:00:00 2001 From: Alex Baranosky Date: Thu, 15 Mar 2012 00:15:47 -0400 Subject: [PATCH] [Issue #82] added one more validation case taking the opts-map into account --- FORMULAS-BACKLOG-AND-FEATURE-IDEAS.md | 2 -- test/midje/ideas/t_formulas.clj | 11 ++++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/FORMULAS-BACKLOG-AND-FEATURE-IDEAS.md b/FORMULAS-BACKLOG-AND-FEATURE-IDEAS.md index cfa5beb61..5baeee33d 100644 --- a/FORMULAS-BACKLOG-AND-FEATURE-IDEAS.md +++ b/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 diff --git a/test/midje/ideas/t_formulas.clj b/test/midje/ideas/t_formulas.clj index 55efe4c77..a6d57df94 100644 --- a/test/midje/ideas/t_formulas.clj +++ b/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))