From d221c05e08627b9dffede6c56e210edca3b04c03 Mon Sep 17 00:00:00 2001 From: Matt Robinson Date: Mon, 15 Nov 2010 10:34:53 -0800 Subject: (#5297) Fix schedule tests that were missing stubs for Time.now Reviewed-by: Jesse Wolfe --- spec/unit/type/schedule_spec.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spec/unit/type/schedule_spec.rb b/spec/unit/type/schedule_spec.rb index 387370fca..8305431a6 100755 --- a/spec/unit/type/schedule_spec.rb +++ b/spec/unit/type/schedule_spec.rb @@ -239,6 +239,7 @@ describe Puppet::Type.type(:schedule) do it "should match if the previous time is prior to the most recent Sunday" do now = Time.utc(2010, "nov", 11, 0, 0, 0) # Thursday + Time.stubs(:now).returns(now) previous = Time.utc(2010, "nov", 6, 23, 59, 59) # Sat @schedule.match?(previous).should be_true @@ -246,6 +247,7 @@ describe Puppet::Type.type(:schedule) do it "should not match if the previous time is after the most recent Saturday" do now = Time.utc(2010, "nov", 11, 0, 0, 0) # Thursday + Time.stubs(:now).returns(now) previous = Time.utc(2010, "nov", 7, 0, 0, 0) # Sunday @schedule.match?(previous).should be_false @@ -262,6 +264,7 @@ describe Puppet::Type.type(:schedule) do it "should match when the previous time is prior to the first day of this month" do now = Time.utc(2010, "nov", 8, 00, 59, 59) + Time.stubs(:now).returns(now) previous = Time.utc(2010, "oct", 31, 23, 59, 59) @schedule.match?(previous).should be_true @@ -269,6 +272,7 @@ describe Puppet::Type.type(:schedule) do it "should not match when the previous time is after the last day of last month" do now = Time.utc(2010, "nov", 8, 00, 59, 59) + Time.stubs(:now).returns(now) previous = Time.utc(2010, "nov", 1, 0, 0, 0) @schedule.match?(previous).should be_false -- cgit