diff options
author | Serdar Sutay <serdar@opscode.com> | 2014-08-11 16:01:01 -0700 |
---|---|---|
committer | Serdar Sutay <serdar@opscode.com> | 2014-08-12 09:48:12 -0700 |
commit | d4330f02ae1f5ac8dc7a481ba52e4a273f630cf4 (patch) | |
tree | d035f27f3ea2c2952011ef7c05ffe96151c71a66 /spec/unit/resource_spec.rb | |
parent | 765288465bd2eca9a99e6fad09cb8947f185f566 (diff) | |
download | chef-d4330f02ae1f5ac8dc7a481ba52e4a273f630cf4.tar.gz |
Return values with Time class after stubbing :now of Time.
Diffstat (limited to 'spec/unit/resource_spec.rb')
-rw-r--r-- | spec/unit/resource_spec.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/spec/unit/resource_spec.rb b/spec/unit/resource_spec.rb index 0eb4db583b..70941e4e82 100644 --- a/spec/unit/resource_spec.rb +++ b/spec/unit/resource_spec.rb @@ -528,7 +528,8 @@ describe Chef::Resource do end it "reports 0 elapsed time if actual elapsed time is < 0" do - Time.stub(:now).and_return(1, 0) + expected = Time.now + Time.stub(:now).and_return(expected, expected - 1) @resource.run_action(:purr) @resource.elapsed_time.should == 0 end |