Closed changeclay closed 11 years ago
You could tweak the matcher to accept something like:
expect(described_class).to have_virtus_attribute(:administered_org_ids).
of_type(Array, :member_type => Integer)
then in the matcher you just do:
attribute = klass.attribute_set[:administered_org_ids]
attribute.options[:type] == Array && attribute.options[:member_type] == Integer
@changeclay Probably virtus-rspec will be helpful for you.
I've created an RSpec matcher so I can just say something like this:
To make the comparison, it just makes a new attribute with these arguments, roughly as follows:
Could you suggest some ways to simplify this?
Thanks