diff options
author | Prabhu Das <prabhu.das@clogeny.com> | 2013-08-19 13:35:46 +0530 |
---|---|---|
committer | adamedx <adamed@opscode.com> | 2013-08-19 11:52:45 -0700 |
commit | 7cde6617d5f3a264cd45d837dec6216d07d1bdc9 (patch) | |
tree | 8a3d321bf03c78cde857697f30c64681bde058c4 | |
parent | 176c36e051dec2cb5a60a754032373d8fbd75270 (diff) | |
download | ohai-7cde6617d5f3a264cd45d837dec6216d07d1bdc9.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 |