summaryrefslogtreecommitdiff
path: root/spec/unit/plugins/darwin/kernel_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/plugins/darwin/kernel_spec.rb')
-rw-r--r--spec/unit/plugins/darwin/kernel_spec.rb12
1 files changed, 9 insertions, 3 deletions
diff --git a/spec/unit/plugins/darwin/kernel_spec.rb b/spec/unit/plugins/darwin/kernel_spec.rb
index 7b36d4b4..6cc587e5 100644
--- a/spec/unit/plugins/darwin/kernel_spec.rb
+++ b/spec/unit/plugins/darwin/kernel_spec.rb
@@ -21,12 +21,18 @@ require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper.rb')
describe Ohai::System, "Darwin kernel plugin" do
before(:each) do
- @plugin = get_plugin("darwin/kernel")
- @plugin[:kernel] = Mash.new
- @plugin[:kernel][:name] = "darwin"
+ @plugin = get_plugin("kernel")
+ @plugin.stub(:collect_os).and_return(:darwin)
+ @plugin.stub(:init_kernel).and_return({})
@plugin.should_receive(:shell_out).with("kextstat -k -l").and_return(mock_shell_out(0, "", ""))
end
+ after(:each) do
+ if Ohai::NamedPlugin.send(:const_defined?, :Kernel)
+ Ohai::NamedPlugin.send(:remove_const, :Kernel)
+ end
+ end
+
it "should not set kernel_machine to x86_64" do
@plugin.stub(:shell_out).with("sysctl -n hw.optional.x86_64").and_return(mock_shell_out(0, "0", ""))
@plugin.run