[rspec-users] Date comparisons
Jarkko Laine
jarkko at jlaine.net
Mon May 5 04:12:43 EDT 2008
On 5.5.2008, at 11.02, Pat Maddox wrote:
> Yes, that was my first idea as well. The Time class is a little
> fucked up in that
>
> < a, b = Time.now, Time.now
> < a == b #=> false
That's definitely a gotcha but I wouldn't necessarily say it's fucked
up. It's just that Time#now returns the current (exact) point of time,
so running it successively on the same machine will by definition
return different values (by a tiny margin but still).
The fact that the textual representation of the two look exactly the
same certainly makes it confusing the first time get bitten by it,
though :-)
Cheers,
//jarkko
--
Jarkko Laine
http://jlaine.net
http://dotherightthing.com
http://www.railsecommerce.com
http://odesign.fi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2417 bytes
Desc: not available
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20080505/37c5ca88/attachment.bin>
More information about the rspec-users
mailing list