Commits

Anonymous committed bfc2508 Draft

added describe and pending macros along with their parameters

Comments (0)

Files changed (2)

 ;; For the reasons on why i implemented it please refer to:
 ;; {{link_to_blogpost}
 
+
+(define pending? (make-parameter #f))
+(define current-description (make-parameter #f))
+
 ;; The base library assumes nothing about outputting/handling  failured or succeeded verifications.
 ;; All it does is provide a protocoll that other parts can hook into to actually do something useful with this information
 
     ((_ expr matcher-name matcher-args+ ...)
      (verify expr (matcher-name matcher-args+ ...)))))
 
+(define-syntax verify-every
+  (syntax-rules ()
+    ((_ expr verification more-verifications ...)
+     (begin
+       (verify expr verification)
+       (verify expr more-verifications)) ...)))
+
 (define-syntax falsify
   (syntax-rules ()
     ((_ expr)
     ((_ expr matcher-name matcher-args+ ...)
      (falsify expr (matcher-name matcher-args+ ...)))))
 
+(define-syntax falsify-every
+  (syntax-rules ()
+    ((_ expr falsification more-falsifications ...)
+     (begin
+       (verify expr falsification)
+       (verify expr more-falsifications)) ...)))
+
+(define-syntax pending
+  (syntax-rules ()
+    ((_ expr more-exprs)
+     (parameterize ((pending? #t))
+       expr more-exprs ...))))
+
+(define-syntax describe
+  (syntax-rules ()
+    ((_ description e e+ ...)
+     (parameterize ((current-description description))
+       e e+ ...))))
+
 ;; i added that little indirection to have control on
 ;; how/if tests are run.
 ;; for example one might to run them in a sandbox
-(use missbehave)
+(use missbehave missbehave-matchers)
 
-(define (callee . args) 'called)
-(define (call-it n)
-  (repeat n (callee)))
+(verify-each 42
+  (is even?)
+  (is > 40)
+  (is < 50))
+
 
 (describe "Missbehave features"
   (describe "implicit subject"