diff options
author | Prabhu Das <prabhu.das@clogeny.com> | 2013-08-19 13:35:46 +0530 |
---|---|---|
committer | adamedx <adamed@opscode.com> | 2013-09-23 16:06:04 -0700 |
commit | 99b023c2ed2a81c2147fba07d5bddb0dc0202c5f (patch) | |
tree | 80905dd4104deec1b80b74057513a273b3ec149d | |
parent | 85ee00d1a5b8c1384a2d9cf181724514d03a3f78 (diff) | |
download | ohai-99b023c2ed2a81c2147fba07d5bddb0dc0202c5f.tar.gz |
Fixed the uptime test-case that was failing in jenkins due to missing stubbing of DateTime.
-rw-r--r-- | spec/unit/plugins/aix/uptime_spec.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/spec/unit/plugins/aix/uptime_spec.rb b/spec/unit/plugins/aix/uptime_spec.rb index 3c8cc6d9..77fae16d 100644 --- a/spec/unit/plugins/aix/uptime_spec.rb +++ b/spec/unit/plugins/aix/uptime_spec.rb @@ -24,16 +24,17 @@ describe Ohai::System, "Aix plugin uptime" do @plugin = Ohai::DSL::Plugin.new(@ohai, File.expand_path("aix/uptime.rb", PLUGIN_PATH)) @plugin[:os] = "aix" @plugin.stub(:popen4).with("who -b").and_yield(nil, StringIO.new, StringIO.new(" . system boot Jul 9 17:51"), nil) - Time.stub_chain(:now, :to_i).and_return(1375857797) + Time.stub_chain(:now, :to_i).and_return(1374258600) + DateTime.stub_chain(:parse, :strftime, :to_i).and_return(1373392260) end it "should set uptime_seconds to uptime" do @plugin.run - @plugin[:uptime_seconds].should == 2465537 + @plugin[:uptime_seconds].should == 866340 end it "should set uptime to a human readable date" do @plugin.run - @plugin[:uptime].should == "28 days 12 hours 52 minutes 17 seconds" + @plugin[:uptime].should == "10 days 00 hours 39 minutes 00 seconds" end end |