summaryrefslogtreecommitdiff
path: root/spec/functional
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2021-01-12 18:13:29 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2021-01-12 18:28:02 -0800
commitc258deb0d3e0e9a1adcfd3b2c78cafea654c91fb (patch)
treeaf36e1273f9f4b0516e628fcb518623a1ac0da3c /spec/functional
parent5750f3218ccd8bb6750234e7acadcb33a738f7de (diff)
downloadchef-c258deb0d3e0e9a1adcfd3b2c78cafea654c91fb.tar.gz
Fix ohai resource spec
1. this speeds it up by avoiding the sleep and the old ohai data 2. this fixes it because it was totally broken and the old uptime value was nil anyway Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'spec/functional')
-rw-r--r--spec/functional/resource/ohai_spec.rb12
1 files changed, 2 insertions, 10 deletions
diff --git a/spec/functional/resource/ohai_spec.rb b/spec/functional/resource/ohai_spec.rb
index 836a4f6da3..3d6caca088 100644
--- a/spec/functional/resource/ohai_spec.rb
+++ b/spec/functional/resource/ohai_spec.rb
@@ -19,10 +19,6 @@
require "spec_helper"
describe Chef::Resource::Ohai do
- let(:ohai) do
- OHAI_SYSTEM
- end
-
let(:node) { Chef::Node.new }
let(:run_context) do
@@ -34,13 +30,9 @@ describe Chef::Resource::Ohai do
shared_examples_for "reloaded :uptime" do
it "should reload :uptime" do
- initial_uptime = ohai[:uptime]
-
- # Sleep for a second so the uptime gets updated.
- sleep 1
-
+ expect(node[:uptime_seconds]).to be nil
ohai_resource.run_action(:reload)
- expect(node[:uptime]).not_to eq(initial_uptime)
+ expect(Integer(node[:uptime_seconds])).to be_an(Integer)
end
end