diff options
author | Matt Robinson <matt@puppetlabs.com> | 2010-11-08 09:41:13 -0800 |
---|---|---|
committer | Markus Roberts <Markus@reality.com> | 2010-11-08 19:52:16 -0800 |
commit | aad700802b9a82dd17dd3f7c7e2557c432ac2aad (patch) | |
tree | eaa48f5002b1de6e3ed5380fec03541f4cc8fb8e /spec | |
parent | 21db472640c8e606565c9693d4737f40a1bf8cce (diff) | |
download | puppet-aad700802b9a82dd17dd3f7c7e2557c432ac2aad.tar.gz puppet-aad700802b9a82dd17dd3f7c7e2557c432ac2aad.tar.xz puppet-aad700802b9a82dd17dd3f7c7e2557c432ac2aad.zip |
[#5225] Fix spec failure that depended on time change
Turns out that:
zero = Time.now # Reset the current time to X:00:00
current = zero - (zero.hour * 3600) - (zero.min * 60) - zero.sec
current is actually 1am on a day where the time falls back (Nov 7th),
not midnight as the test expected.
Reviewed-by: Paul Berry <paul@puppetlabs.com>
Diffstat (limited to 'spec')
-rwxr-xr-x | spec/unit/type/schedule_spec.rb | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/spec/unit/type/schedule_spec.rb b/spec/unit/type/schedule_spec.rb index 420cffd44..86b3cdd35 100755 --- a/spec/unit/type/schedule_spec.rb +++ b/spec/unit/type/schedule_spec.rb @@ -227,10 +227,7 @@ describe Puppet::Type.type(:schedule) do end it "should match if the times are one minute apart and the current minute and hour are 0" do - zero = Time.now - - # Reset the current time to X:00:00 - current = zero - (zero.hour * 3600) - (zero.min * 60) - zero.sec + current = Time.utc(2010, "nov", 7, 0, 0, 0) # Now set the previous time to one minute before that previous = current - 60 @@ -240,10 +237,9 @@ describe Puppet::Type.type(:schedule) do end it "should not match if the times are 23 hours and 58 minutes apart and the current hour is 23 and the current minute is 59" do - zero = Time.now # Reset the previous time to 00:00:00 - previous = zero - (zero.hour * 3600) - (zero.min * 60) - zero.sec + previous = Time.utc(2010, "nov", 7, 0, 0, 0) # Set the current time to 23:59 now = previous + (23 * 3600) + (59 * 60) |