summaryrefslogtreecommitdiff
path: root/spec/unit/plugins/openbsd/kernel_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/plugins/openbsd/kernel_spec.rb')
-rw-r--r--spec/unit/plugins/openbsd/kernel_spec.rb13
1 files changed, 10 insertions, 3 deletions
diff --git a/spec/unit/plugins/openbsd/kernel_spec.rb b/spec/unit/plugins/openbsd/kernel_spec.rb
index 8979b431..c7732862 100644
--- a/spec/unit/plugins/openbsd/kernel_spec.rb
+++ b/spec/unit/plugins/openbsd/kernel_spec.rb
@@ -21,14 +21,21 @@ require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper.rb')
describe Ohai::System, "OpenBSD kernel plugin" do
before(:each) do
- @plugin = get_plugin("openbsd/kernel")
+ @plugin = get_plugin("kernel")
+ @plugin.stub(:collect_os).and_return(:openbsd)
+ @plugin.stub(:init_kernel).and_return({})
@plugin.stub(:shell_out).with("uname -i").and_return(mock_shell_out(0, "foo", ""))
@plugin.stub(:shell_out).with("sysctl kern.securelevel").and_return(mock_shell_out(0, "kern.securelevel: 1\n", ""))
@plugin.stub(:shell_out).with( Ohai.abs_path( "/usr/bin/modstat" )).and_return(mock_shell_out(0, " 1 7 0xc0400000 97f830 kernel", ""))
- @plugin[:kernel] = Mash.new
- @plugin[:kernel][:name] = "openbsd"
end
+ after(:each) do
+ if Ohai::NamedPlugin.send(:const_defined?, :Kernel)
+ Ohai::NamedPlugin.send(:remove_const, :Kernel)
+ end
+ end
+
+
it "should set the kernel_os to the kernel_name value" do
@plugin.run
@plugin[:kernel][:os].should == @plugin[:kernel][:name]