Displaying 2 results from an estimated 2 matches for "met_bi".
Did you mean:
met_by
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
2007 Jan 27
1
should expectation syntax has changed
This is just a note in case anyone else is using the (I believe
experimental) custom expectations.
The custom expectation I had written used the custom ''met_by?''
function, which now appears to have been replaced by the ''matches?''
function to determine whether the expectation is met.
Steve