summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Mundrawala <jdmundrawala@gmail.com>2016-02-01 14:48:50 -0800
committerJay Mundrawala <jdmundrawala@gmail.com>2016-02-01 15:37:11 -0800
commitf35408c161327cc65088b9b39ee0df111032a99a (patch)
tree272209ff03f05cc799f87907bd4d69e9211dfd28
parenta96e0c9c458bf987e409a5ba30853fc0244ec9f9 (diff)
downloadchef-jdm/reboot-pending-speed.tar.gz
Don't keep rerunning ohai for reboot_pending_specjdm/reboot-pending-speed
Running Ohai is slow. This should know almost 2 mins off the runtime of the tests.
-rw-r--r--spec/functional/dsl/reboot_pending_spec.rb9
1 files changed, 2 insertions, 7 deletions
diff --git a/spec/functional/dsl/reboot_pending_spec.rb b/spec/functional/dsl/reboot_pending_spec.rb
index 966f8b58c5..e92b83504f 100644
--- a/spec/functional/dsl/reboot_pending_spec.rb
+++ b/spec/functional/dsl/reboot_pending_spec.rb
@@ -22,17 +22,12 @@ require "spec_helper"
describe Chef::DSL::RebootPending, :windows_only do
def run_ohai
- ohai = Ohai::System.new
- # Would be nice to limit this to platform/kernel/arch etc for Ohai 7
- ohai.all_plugins
- node.consume_external_attrs(ohai.data,{})
-
- ohai
+ node.consume_external_attrs(OHAI_SYSTEM.data,{})
end
let(:node) { Chef::Node.new }
- let(:events) { Chef::EventDispatch::Dispatcher.new }
let!(:ohai) { run_ohai } # Ensure we have necessary node data
+ let(:events) { Chef::EventDispatch::Dispatcher.new }
let(:run_context) { Chef::RunContext.new(node, {}, events) }
let(:recipe) { Chef::Recipe.new("a windows cookbook", "the windows recipe", run_context) }
let(:registry) { Chef::Win32::Registry.new(run_context) }