[rspec-users] rspec tutorial - "one item" should equal "one item"

philip reed philipreedtech at gmail.com
Mon Dec 4 15:24:52 EST 2006

Apologies in advance if this is a Ruby-ignorant question.

I'm working my way through the tutorial, and I made it to page 3,
where I found a discrepancy.   In the 5th code block, preceded by
"What's the simplest thing we can add to meet all of the current
expectations?" I add the trivial return value to the top method as
shown.   Now the stack is supposed to be returning "one item", but
instead of passing the test as show in the tutorial, I get:

'A stack with one item should return top when you send it 'top'' FAILED
"one item" should equal "one item"

Finished in 0.0 seconds

3 specifications, 1 failure

I would guess this is some sort of issue about equivalence of two
instances versus having the same instance in Ruby.   Am I right?   At
any rate, is this behavior that's changed since the tutorial, or do I
need to look harder in my tutorial code to make sure I didn't
implement anything wrong?

I can post a snapshot of the code if needed.


Philip Reed, Web developer


Web.  Made simple.

More information about the rspec-users mailing list