      (TestResults this (map #(invoke-test % active) children))
      (catch Throwable t
        (TestThrown this active t)))))
-
-(defn- has-after?
-  "True if Context c or any of its parents has an :after function."
-  [c]
-  (or (:after c)
-      (some has-after? (:parents c))))
 
 (deftype ContextualContainer [contexts children] :as this
   TestInvokable

                          ~@after))]
        `(def ~name (Context ~contexts ~before-fn ~after-fn '~m nil))))))

(defprotocol TestInvokable
  (invoke-test [t active]))

(deftype TestResults [source children])

(deftype TestPassed [source states])

(deftype TestFailed [source states])

(deftype TestThrown [source states throwable])

(deftype ContextualAssertion [contexts pred] :as this
  TestInvokable

                  (filter #(not (contains? active %))
                          (reverse contexts))))))))


;;; Container types

(deftype SimpleContainer [children] :as this
  TestInvokable
