opscode/chef — pull request #2095 by lamont-granquist (2014-09-20 00:10:38+00:00)
Title: Use homebrew for default package provider on OS X

Via Chef RFC 016[0], fixes issue #1709, adding the `homebrew_package`
resource with the `homebrew` provider, and setting it as the default
for Mac OS X platforms (`mac_os_x`, `mac_os_x_server`). This will
still require that homebrew is installed on the system somehow, but
doesn't require use of the cookbook if users choose to install via
some other method (pre-built images, for example).

[0]: https://github.com/opscode/chef-rfc/blob/master/rfc016-homebrew-osx-package-provider.md

Cleanup/fixes based on feedback

* Use accessor methods instead of instance variables for new_resource
and current_resource in the provider.
* Use Chef::JSONCompat
* Move etc require to top
* Use let for homebrew_owner specs
* Set homebrew owner attribute and remove ENV stubs
* Add repeated stubs in LCR to a before block
* Wrap action method tests in a context so provider.current_resource
does the right thing
* Add timeout for #get_response_from_command (bonus, per
#opscode-cookbooks/homebrew issue 49)

Better exception for homebrew owner mixin

Create an exception class for when the owner isn't found, subclassed
from Package. Update the exception output text.