[rspec-users] Odd parameter munging with with()
hughes.james at gmail.com
Tue Feb 20 17:10:20 EST 2007
On 2/20/07, David Chelimsky <dchelimsky at gmail.com> wrote:
> On 2/20/07, James Hughes <hughes.james at gmail.com> wrote:
> > On 2/20/07, David Chelimsky <dchelimsky at gmail.com> wrote:
> > > Here's the same output w/ the latest trunk. Note that it shows #with
> > > correctly receiving a Hash now.
> > Ok, just one more comment here and then I'll shut up. David, I just
> > now noticed your comment on the RFE:
> > "I've fixed the message so it will show you the two hashes (expected
> > and actual), but I think that getting RSpec to make decisions about
> > stringifying keys would be a mistake. To that end, I think the right
> > thing is for you to change your spec to expect a Hash with stringy
> > keys."
> > You're right, changing the hash to have string keys was not a burden
> > but doing this had zero effect on whether the spec passed or not; my
> > point all along (and sorry if this was never made clear enough) was
> > that it did seem like a burden to convert my hash to an array of
> > 2-element arrays in order for the spec to pass. Not to mention, this
> > would break any code under test that was expecting to deal with a hash
> > (as in the #delete example that I mentioned in a separate mail).
> OK - now I'm confused.
It would appear that I am the one who is confused. I had a distinct
memory of my spec still failing after I had changed the keys to
strings, but I just reverted to r1514 to double check that, and
indeed, it passed with string keys, and failed with symbol keys. I got
so caught up in chasing down all the possible combinations of how to
do this that I somehow convinced myself that the keys issue was a red
herring. My apologies.
At least you fixed the message bug ;)
More information about the rspec-users