RiotGames/berkshelf — pull request #516 by sethvargo (2013-05-18 06:17:45+00:00)
Title: Default locations are broken

Given a `Berksfile`:

```ruby
chef_api :config
site :opscode

cookbook 'berkshelf-cookbook-fixture', '1.0.0'
```

And `berkshelf-cookbook-fixture` does not exist on the Chef Server.

When running `berks install`

Ridley throws an error that we aren't catching and it doesn't try to download from the community site.

---

## Scenario
```text
Scenario: with a default chef_api(1) and site(2) location with a cookbook source that is not satisfied by the chef_api(1) location
Given I write to "Berksfile" with:
"""
chef_api :config
site :opscode

cookbook 'berkshelf-cookbook-fixture', '1.0.0'
"""
And the Chef server does not have the cookbooks:
| berkshelf-cookbook-fixture | 1.0.0 |
When I successfully run `berks install`
Then the output should contain:
"""
Installing berkshelf-cookbook-fixture (1.0.0) from site: 'http://cookbooks.opscode.com/api/v1/cookbooks'
"""
And the cookbook store should have the cookbooks:
| berkshelf-cookbook-fixture | 1.0.0 |
And the exit status should be 0
```
---

## Stacktrace
```text
Scenario: with a default chef_api(1) and site(2) location with a cookbook source that is not satisfied by the chef_api(1) location # features/default_locations.feature:28
Given I write to "Berksfile" with: # aruba-0.5.2/lib/aruba/cucumber.rb:31
"""
chef_api :config
site :opscode

cookbook 'berkshelf-cookbook-fixture', '1.0.0'
"""
And the Chef server does not have the cookbooks: # features/step_definitions/chef_server_steps.rb:3
| berkshelf-cookbook-fixture | 1.0.0 |
When I successfully run `berks install` # aruba-0.5.2/lib/aruba/cucumber.rb:71
Exit status was 47 but expected it to be 0. Output:

Ridley::Errors::ResourceNotFound caused by #: {"error":["Cannot find a cookbook named berkshelf-cookbook-fixture"]}

(RSpec::Expectations::ExpectationNotMetError)
features/default_locations.feature:38:in `When I successfully run `berks install`'
Then the output should contain: # aruba-0.5.2/lib/aruba/cucumber.rb:113
"""
Installing berkshelf-cookbook-fixture (1.0.0) from site: 'http://cookbooks.opscode.com/api/v1/cookbooks'
"""
And the cookbook store should have the cookbooks: # features/step_definitions/filesystem_steps.rb:54
| berkshelf-cookbook-fixture | 1.0.0 |
And the exit status should be 0 # aruba-0.5.2/lib/aruba/cucumber.rb:154
```