summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorTyler Ball <tyleraball@gmail.com>2014-10-13 13:58:09 -0500
committerTyler Ball <tyleraball@gmail.com>2014-10-13 13:58:09 -0500
commit87ebd29a5632d4a2598b12b99ecc9d2ee2b4586f (patch)
treed8c29af59da6cc228a6dfbeae133f9fe92fed788 /spec
parent57b6b93cfe8f32e30c03503d1facf9fac011842c (diff)
parent4cb27331d81b394b816278e2bed6b3395b54b9c9 (diff)
downloadchef-87ebd29a5632d4a2598b12b99ecc9d2ee2b4586f.tar.gz
Merge pull request #2215 from opscode/tball/homebrew_fix
Fixing bug where tried to use the homebrew provider on OSX and didn't correctly check for lack of homebrew-specific attribute on the resource
Diffstat (limited to 'spec')
-rw-r--r--spec/unit/provider/package/homebrew_spec.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/unit/provider/package/homebrew_spec.rb b/spec/unit/provider/package/homebrew_spec.rb
index d38458546d..dccd8edf11 100644
--- a/spec/unit/provider/package/homebrew_spec.rb
+++ b/spec/unit/provider/package/homebrew_spec.rb
@@ -158,6 +158,15 @@ describe Chef::Provider::Package::Homebrew do
allow(provider).to receive(:shell_out!).and_return(OpenStruct.new(:stdout => 'homestarrunner'))
expect(provider.brew('info', 'opts', 'bananas')).to eql('homestarrunner')
end
+
+ context "when new_resource is Package" do
+ let(:new_resource) { Chef::Resource::Package.new('emacs') }
+
+ it "does not try to read homebrew_user from Package, which does not have it" do
+ allow(provider).to receive(:shell_out!).and_return(OpenStruct.new(:stdout => 'zombo'))
+ expect(provider.brew).to eql('zombo')
+ end
+ end
end
context 'when testing actions' do