RedHatQE/katello.auto — pull request #615 by AdamSaleh (2013-04-17 11:58:21+00:00)
Title: Preconditions and fake-content

Added preconditions to protocol functions and to record constructors, up...dated fake content to work with protocols.

Preconditions are added in defmacro with simple anotations:

(defrecord Provider [id name description ^Organization org])

Now if I try creating Provider \w-o org, it works,

=> (newProvider {:name "abcd"})
#katello.Provider{:id nil, :name "abcd", :description nil, :org nil}

but, if I assign something that isn't katello.Organization, it fails

=> (newProvider {:name "abcd" :org "efg"})
AssertionError Assert failed: (clojure.core/or (clojure.core/not (clojure.core/contains? m :org)) (clojure.core/instance? Organization (:org m))) katello/newProvider (katello.clj:37)