diff options
-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 |