Permalink
Browse files

[OHAI-412] fix missing stubs in darwin kernel spec

Some popen commands weren't being stubbed so the tests fail on windows.
  • Loading branch information...
danielsdeleo committed Oct 24, 2012
1 parent 0a43b87 commit 968c8091d4f0dcae3569e2f32c7c4b7ab674cbc2
Showing with 2 additions and 0 deletions.
  1. +2 −0 spec/unit/plugins/darwin/kernel_spec.rb
@@ -25,6 +25,7 @@
@plugin = Ohai::DSL::Plugin.new(@ohai, File.expand_path("darwin/kernel.rb", PLUGIN_PATH))
@plugin[:kernel] = Mash.new
@plugin[:kernel][:name] = "darwin"
+ @plugin.should_receive(:popen4).with("kextstat -k -l").and_yield(1, StringIO.new, StringIO.new, StringIO.new)
end
it "should not set kernel_machine to x86_64" do
@@ -40,6 +41,7 @@
end
it "should set the kernel_os to the kernel_name value" do
+ @plugin.stub!(:from).with("sysctl -n hw.optional.x86_64").and_return("1")
@plugin.run
@plugin[:kernel][:os].should == @plugin[:kernel][:name]
end

0 comments on commit 968c809

Please sign in to comment.