diff options
Diffstat (limited to 'spec/unit/plugins/darwin/platform_spec.rb')
-rw-r--r-- | spec/unit/plugins/darwin/platform_spec.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/spec/unit/plugins/darwin/platform_spec.rb b/spec/unit/plugins/darwin/platform_spec.rb index c7b02f37..c700c8cb 100644 --- a/spec/unit/plugins/darwin/platform_spec.rb +++ b/spec/unit/plugins/darwin/platform_spec.rb @@ -22,11 +22,16 @@ require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper.rb') describe Ohai::System, "Darwin plugin platform" do before(:each) do @plugin = get_plugin("darwin/platform") - - @plugin[:os] = "darwin" + @plugin.stub(:collect_os).and_return(:darwin) @stdout = "ProductName: Mac OS X\nProductVersion: 10.5.5\nBuildVersion: 9F33" @plugin.stub(:shell_out).with("/usr/bin/sw_vers").and_return(mock_shell_out(0, @stdout, "")) end + + after(:each) do + if Ohai::NamedPlugin.send(:const_defined?, :Platform) + Ohai::NamedPlugin.send(:remove_const, :Platform) + end + end it "should run sw_vers" do @plugin.should_receive(:shell_out).with("/usr/bin/sw_vers").and_return(mock_shell_out(0, @stdout, "")) |