search for: compare_date

Displaying 1 result from an estimated 1 matches for "compare_date".

2007 Jan 09
9
Date Approximation in Specs
The floating-point expectations allow for an error tolerance. Is there any similar facility for dates? For example, say I have a custom class that handles date/time spans and I want to spec it: context "A DateRange span" do specify "should know when a week ago is :)" do d = DateRange.new d.last_week.should_be_close_to(1.week.ago, 24*60*60) end end The idea