diff options
author | Josh Murphy <josh.murphy@cerner.com> | 2014-11-18 07:41:27 -0600 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2015-01-25 11:03:39 -0800 |
commit | d9092ef8ed9e79f5ca43604083b9a6aab1d3b889 (patch) | |
tree | 28af00e1e89e711b8af19e78e0fd5fc4a00f1594 /spec/unit/knife | |
parent | df0e30c5d2b82d6b1a45f13cbc9735bd670f35d3 (diff) | |
download | chef-d9092ef8ed9e79f5ca43604083b9a6aab1d3b889.tar.gz |
Added cookbook_path configuration value to warning message for uploading cookbooks and updated tests
Diffstat (limited to 'spec/unit/knife')
-rw-r--r-- | spec/unit/knife/cookbook_upload_spec.rb | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/spec/unit/knife/cookbook_upload_spec.rb b/spec/unit/knife/cookbook_upload_spec.rb index 3e6381083c..fb94886cad 100644 --- a/spec/unit/knife/cookbook_upload_spec.rb +++ b/spec/unit/knife/cookbook_upload_spec.rb @@ -285,9 +285,22 @@ E knife.run end - it 'should warn users that no cookbooks exist' do - expect(knife.ui).to receive(:warn).with(/Could not find any cookbooks in your cookbook path\. Use --cookbook-path to specify the desired path\./) - knife.run + context 'when cookbook path is an array' do + it 'should warn users that no cookbooks exist' do + knife.config[:cookbook_path] = ['/chef-repo/cookbooks', '/home/user/cookbooks'] + expect(knife.ui).to receive(:warn).with( + /Could not find any cookbooks in your cookbook path: #{knife.config[:cookbook_path].join(', ')}\. Use --cookbook-path to specify the desired path\./) + knife.run + end + end + + context 'when cookbook path is a string' do + it 'should warn users that no cookbooks exist' do + knife.config[:cookbook_path] = '/chef-repo/cookbooks' + expect(knife.ui).to receive(:warn).with( + /Could not find any cookbooks in your cookbook path: #{knife.config[:cookbook_path]}\. Use --cookbook-path to specify the desired path\./) + knife.run + end end end end |