[rspec-users] Testing the <=> operator

Chris DiMartino chris.dimartino at gmail.com
Tue Mar 16 00:16:19 EDT 2010


I'm having trouble getting rspec to allow me to test my Comparable class.  I
would like to test the <=> method, but rspec is giving me unexpected
results:

@hand = Hand.new('R')
@other_hand = Hand.new('S')
@hand.should be > @other_hand

expected > #<RPS::Hand:0x7f2d93661490>, got #<RPS::Hand:0x7f2d936615d0
@guess="R">

Shouldn't that test be checking for the comparison operator?

chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20100316/d41e171d/attachment.html>


More information about the rspec-users mailing list