Skip to content

Commit

Permalink
[Issue marick#82] work in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexBaranosky committed Feb 22, 2012
1 parent a75b451 commit 1bb5b25
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/midje/ideas/formulas.clj
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
(ns midje.ideas.formulas
(:use [utilize.macro :only [macro-for]]))

(def formula-run-bindings (atom {}))

;; add all of this to midje.sweet

(def #^:dynamic *num-generations* 100)

Expand All @@ -10,9 +14,12 @@
`(do
(macro-for [_# (range (dec *num-generations*))]
(let ~bindings
;; must I force the bindings to not use destructuring?
;; take left side of each binding, and its matching value and (reset! formula-run-bindings formula-binding-map)
(midje.sweet/fact ~docstring?
~@body :formula :formula-in-progress )))

(let ~bindings
(let ~bindings
;; ditto
(midje.sweet/fact ~docstring?
~@body :formula :formula-conclude )))))
4 changes: 4 additions & 0 deletions src/midje/unprocessed.clj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
[utilize.seq :only [find-first]]))
(immigrate 'midje.checkers)

;; stick inside midje.ideas.formula

(def ^{:private true} formula-reports (atom []))

(defn ^{:private true} report-formula [report-map]
Expand All @@ -27,6 +29,8 @@
(report {:type :pass}) )
(reset! formula-reports [])))

;;;;;;

(letfn [(fail [type actual call]
{:type type
:description (nested-fact-description)
Expand Down

0 comments on commit 1bb5b25

Please sign in to comment.