[rspec-users] Date comparisons

Steve Downey steve.downtown at gmail.com
Sat May 3 12:37:29 EDT 2008


I've seen that one too.  Maybe has to do with how equality is defined in the
Time or DateTime class.

I get around it by comparing the string-ified versions:

  foo.time.to_s.should == expected_time.to_s



On Sat, May 3, 2008 at 9:17 AM, Joe Van Dyk <joe at pinkpucker.net> wrote:

> I occasionally get this error:
>
> 1)
> 'A puzzle once featured, should no longer be nominated' FAILED
> expected: Sun May 04 09:10:26 -0700 2008,
>     got: Sun May 04 09:10:26 -0700 2008 (using ==)
> ./spec/models/puzzle_spec.rb:180:
>
>
>
> So, the dates looks the same to me.  Any ideas for how to debug?
>
> Joe
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20080503/7cb8294b/attachment.html>


More information about the rspec-users mailing list