solnic/virtus — pull request #297 by ka8725 (2014-10-02 12:45:34+00:00)
Title: Test for strict coercion of Array

I think that strict mode for coercion of Array attribute should raise the coercion error exception, but it doesn't. I've added tests for strict mode for two attribute types (integer and array) to make sure that they work correctly. See that the test for integer attribute passes but for array fails.

Unfortunately I can't figure out what is problem but it seems to me that issue in this line: https://github.com/solnic/virtus/blob/master/lib/virtus/attribute/strict.rb#L14

In the code we have here changed `self` after evaluating `super`. It is because `Collection` attribute (it's a virtus' attribute type for Array) actually calls coercion of a superclass (`Attribute`) in this case but not itself.

Could you approve that it's really a bug and help to fix this if it's true? Thanks!