You can use use be_within, like this:

describe "time" do
  it "is equal" do
    Time.now.should == Time.now  #fails
  end
  it "is close" do
   Time.now.should be_within(0.1).of(Time.now)
  end
end


On Thu, Jul 5, 2012 at 12:20 PM, Tsvetelina Borisova
<[email protected]> wrote:
> I have this in one rspec test:
>  expected: Thu, 05 Jul 2012 19:07:31 UTC +00:00
>   got:    Thu, 05 Jul 2012 19:07:31 UTC +00:00
>
> Do you know how to tell to rspec not to consider the miliseconds? Thanks in
> advance : )
>
> --
> You received this message because you are subscribed to the Google Groups
> "rspec" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/rspec/-/UngzRJ7DbbcJ.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/rspec?hl=en.



-- 
Alex Chaffee - [email protected]
http://alexchaffee.com
http://twitter.com/alexch

-- 
You received this message because you are subscribed to the Google Groups 
"rspec" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rspec?hl=en.

Reply via email to