diff options
author | danielsdeleo <dan@opscode.com> | 2012-10-24 11:28:35 -0700 |
---|---|---|
committer | adamedx <adamed@opscode.com> | 2013-08-19 11:43:11 -0700 |
commit | 898e27580966699177976c2737d82560178aefc3 (patch) | |
tree | ab087f704989bcef9f1ce278c52b166051629f27 /spec | |
parent | 6c6b00ffaa985cca51f2e4b6241ebe1495d5da29 (diff) | |
download | ohai-898e27580966699177976c2737d82560178aefc3.tar.gz |
[OHAI-412] fix missing stubs in darwin kernel spec
Some popen commands weren't being stubbed so the tests fail on windows.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/unit/plugins/darwin/kernel_spec.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/spec/unit/plugins/darwin/kernel_spec.rb b/spec/unit/plugins/darwin/kernel_spec.rb index f7da94bf..5ce7c1ba 100644 --- a/spec/unit/plugins/darwin/kernel_spec.rb +++ b/spec/unit/plugins/darwin/kernel_spec.rb @@ -25,6 +25,7 @@ describe Ohai::System, "Darwin kernel plugin" do @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 @@ describe Ohai::System, "Darwin kernel plugin" do 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 |