[rspec-users] Should change not comparing arrays how I expected
Pat Maddox
pergesu at gmail.com
Sun Sep 28 17:20:25 EDT 2008
Michael Latta <lattam at mac.com> writes:
> David,
>
> It seems to me that the root of the problem is that the specification
> is incorrect. Since Rails returns association proxies the
> specification fails because it does not specify what the behavior
> should be. I would suggest that instead of patching the change
> matcher, that you should add a change_contents matcher that matches
> the contents of a collection vs. the contents of a collection. That
> way the framework is not guessing what was meant, but relying on the
> specification to be correct. Since that is really what you want to
> specify (the contents have changed). I think this is cleaner.
I think this is a leaky abstraction, and letting it leak out like that
is worse than having to do a little framework mojo on our part.
Pat
p.s. does anyone else think that "magic" sounds deragotory while "mojo"
sounds cool? I propose we say the rspec internals "got their mojo workin"
rather than "magic" :)
More information about the rspec-users
mailing list