reifyhealth / specmonstah

Specmonstah will eat the face off your test fixtures
MIT License
359 stars 18 forks source link

combining `{:refs {:x ::sm/omit}}` and `{:spec-gen {:x nil}}` does not work #36

Closed flyingmachine closed 6 years ago

flyingmachine commented 6 years ago

:x should be present and nil. instead it's absent.

Example query:

(sg/ent-db-spec-gen-attr {:schema schema}
                         {:todo-list [[1 {:refs     {:owner-id ::sm/omit}
                                          :spec-gen {:owner-id nil}}]]})
manderson202 commented 6 years ago

Just saw this. The problem is deciding which takes precedence: the "omit" or the spec-gen. Perhaps this should be a query compile error since intent is ambiguous?

flyingmachine commented 6 years ago

I think whatever you pass to :spec-gen in the query should take precedence. :refs {:owner-id ::sm/omit} applies to building the ent db, and visiting functions' default behavior should respect whatever's in the ent db. The query is meant to specify deviations from the default behavior, so whatever's in the :spec-gen part of the query should take precedence over whatever has resulted from default behavior up to that point.

flyingmachine commented 6 years ago

Hmmm I must have been mistaken about this, I can't repro it