Closed jpmoral closed 9 years ago
attribute's primitive is an instance of axiom type you could use that for your matchers although I gotta warn you it's a subject to change in virtus 2.0.
In general though I wouldn't recommend writing tests like that, you're checking some internal details which is very brittle. It's way better to check actual behavior of an object rather than its attribute setup.
We have the following code:
and we are trying unsuccessfully to write a matcher for it using virtus-matchers.
The following fails:
That project compares the passed in type (in this case
Virtus::Attribute::Boolean
) with the attribute'sprimitive
. It fails apparently because the primitive of aBoolean
is aBasicObject
.What's the best way of writing a matcher without depending on Virtus's private APIs?