Re: [rspec-users] Problem Comparing Dates

2009-08-21 Thread George Anderson
Spot on, Tom. Thanks. For the (google) record: Time.usec Returns just the number of microseconds for the given time. ActiveRecord datetime attributes ignore microseconds (at least with the SQLite adapter). In my case: now.usec: 991786 @verif

Re: [rspec-users] Problem Comparing Dates

2009-08-21 Thread Tom Stuart
On 21 Aug 2009, at 17:15, George Anderson wrote: expected: Fri, 21 Aug 2009 16:08:51 UTC +00:00, got: Fri, 21 Aug 2009 16:08:51 UTC +00:00 (using ==) They're identical, no? Not necessarily -- Time instances are microsecond precision, so two of them can differ (in microseconds) but hav

[rspec-users] Problem Comparing Dates

2009-08-21 Thread George Anderson
I'm having an issue comparing two seemingly equivalent dates: spec: it "sets the user's session_key_updated_at" do now = Time.zone.now Timecop.freeze(now) do verify_user @verified_user.session_key_updated_at.should == now end end output: sets the user's session_key_updated_at expect