diff options
| author | Ryota Arai <ryota.arai@gmail.com> | 2013-10-30 23:39:09 +0900 |
|---|---|---|
| committer | Bryan McLellan <btm@opscode.com> | 2013-11-26 07:31:26 -0800 |
| commit | 0d04ea2672e0ec5d492e5640fe3fd94a64e47554 (patch) | |
| tree | 15dde784f0f58ea3f364cbcc90d36fd52eddafef /spec/unit/client_spec.rb | |
| parent | 711a8baebd6ccbdac54a30aa6fe8d7b0493e84b7 (diff) | |
| download | chef-0d04ea2672e0ec5d492e5640fe3fd94a64e47554.tar.gz | |
Raise CookbookNotFound error if any directory of cookbook_path contains no cookbook.
Diffstat (limited to 'spec/unit/client_spec.rb')
| -rw-r--r-- | spec/unit/client_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/unit/client_spec.rb b/spec/unit/client_spec.rb index 11c887d734..67b6623402 100644 --- a/spec/unit/client_spec.rb +++ b/spec/unit/client_spec.rb @@ -447,6 +447,20 @@ shared_examples_for Chef::Client do end end + describe "assert_cookbook_path_not_empty" do + before do + Chef::Config[:solo] = true + Chef::Config[:cookbook_path] = ["/path/to/invalid/cookbook_path"] + end + context "when any directory of cookbook_path contains no cookbook" do + it "raises CookbookNotFound error" do + expect do + @client.send(:assert_cookbook_path_not_empty, nil) + end.to raise_error(Chef::Exceptions::CookbookNotFound, 'No cookbook found in ["/path/to/invalid/cookbook_path"], make sure cookbook_path is set correctly.') + end + end + end + end describe Chef::Client do |
