Could it be a problem with the logger you're using? Try doing a puts
instead.

David

On Wed, May 11, 2011 at 11:08 AM, Iain Barnett <iainspeed / gmail.com> wrote:

> Hi,
>
> RSpec is taking a day off the date in my tests:
>
> RSpec:
>
>    let(:vtime_start){ Time.now - 10 }
>
>    (logged) => 2011-05-10 15:57:39 +0100
>
> irb:
>
>   Time.now - 10
>   => 2011-05-11 15:57:50 0100
>
> system commandline:
>
>    $ date
>    => Wed 11 May 2011 16:01:00 BST
>
> irb again:
>
>    (Time.parse `date`.chomp) - 10
>    => 2011-05-11 16:02:06 0100
>
> I'm running ruby 1.9.2p0 (2010-08-18) [x86_64-darwin10.4.0], OSX 10.6.6,
> RSpec 2.5.2
>
> Is there something about the way Ruby deals with time that I should look
> at, or have I done something stupid, or should I move this over to the RSpec
> list?
>
> Any help is much appreciated.
>
> Regards,
> Iain
>