[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, master, updated. 2.6.3-345-g919f443

Markus Roberts Markus at reality.com
Wed Nov 17 18:20:57 UTC 2010


The following commit has been merged in the master branch:
commit d221c05e08627b9dffede6c56e210edca3b04c03
Author: Matt Robinson <matt at puppetlabs.com>
Date:   Mon Nov 15 10:34:53 2010 -0800

    (#5297) Fix schedule tests that were missing stubs for Time.now
    
    Reviewed-by: Jesse Wolfe <jesse at puppetlabs.com>

diff --git a/spec/unit/type/schedule_spec.rb b/spec/unit/type/schedule_spec.rb
index 387370f..8305431 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

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list