josephwilk / stereotype

A fixture library for setting up test data in Clojure
https://github.com/josephwilk/stereotype
26 stars 1 forks source link

Exception on trying to fetch a defined stereotype #7

Open josephwilk opened 11 years ago

josephwilk commented 11 years ago
Exception in thread "main" clojure.lang.ExceptionInfo: throw+: {:type :stereotype.stereotypes/undefined-stereotype, :stereotype "visuals"} {:object {:type :stereotype.stereotypes/undefined-stereotype, :stereotype "visuals"}, :environment {stereotype-id "visuals", overiding-attributes {:enabled true, :entry_time 0, :urn "soundcloud:sounds:75167176", :visual_url "http://cdnurl1.jpg"}, matching-stereotype-fn nil}}
    at stereotype.stereotypes$attributes_for.invoke(stereotypes.clj:25)
    at stereotype.stereotypes$build.doInvoke(stereotypes.clj:31)

If you define your stereotypes in a different namespace then we have trouble resolving them from just the entity names. Need to think on this some more..

For now, mixing the namespace that defines stereotypes into your testing stereotype fixes this

(:require
  [stereotypes.fixtures :refer :all]
josephwilk commented 11 years ago

Failing test for this bug here:

https://github.com/josephwilk/stereotype/blob/issue-7/test/stereotype/integration/t_namespaces.clj#L16