summaryrefslogtreecommitdiff
path: root/spec/integration
diff options
context:
space:
mode:
authorJohn Keiser <jkeiser@opscode.com>2013-10-11 13:51:09 -0700
committerJohn Keiser <jkeiser@opscode.com>2013-10-11 13:51:09 -0700
commit169c9622fd490949ca7113a7c0212b72d87438bd (patch)
treeadda121893899825259d2785c46bf8bdee9e331d /spec/integration
parent6d58ff931dda2d5bfa0eb8b7feadf5cd0fb37c8e (diff)
downloadchef-169c9622fd490949ca7113a7c0212b72d87438bd.tar.gz
Fix --chef-repo-path
Diffstat (limited to 'spec/integration')
-rw-r--r--spec/integration/knife/chef_repo_path_spec.rb43
1 files changed, 43 insertions, 0 deletions
diff --git a/spec/integration/knife/chef_repo_path_spec.rb b/spec/integration/knife/chef_repo_path_spec.rb
index 1825c5a00a..4ffb179a4b 100644
--- a/spec/integration/knife/chef_repo_path_spec.rb
+++ b/spec/integration/knife/chef_repo_path_spec.rb
@@ -52,6 +52,28 @@ describe 'chef_repo_path tests' do
file 'users/user3.json', {}
end
+ it 'knife list --local -Rfp --chef-repo-path chef_repo2 / grabs chef_repo2 stuff' do
+ Chef::Config.delete(:chef_repo_path)
+ knife("list --local -Rfp --chef-repo-path #{path_to('chef_repo2')} /").should_succeed <<EOM
+/clients/
+/clients/client3.json
+/cookbooks/
+/cookbooks/cookbook3/
+/cookbooks/cookbook3/metadata.rb
+/data_bags/
+/data_bags/bag3/
+/data_bags/bag3/item3.json
+/environments/
+/environments/env3.json
+/nodes/
+/nodes/node3.json
+/roles/
+/roles/role3.json
+/users/
+/users/user3.json
+EOM
+ end
+
context 'when all _paths are set to alternates' do
before :each do
%w(client cookbook data_bag environment node role user).each do |object_name|
@@ -60,6 +82,27 @@ describe 'chef_repo_path tests' do
Chef::Config.chef_repo_path = File.join(Chef::Config.chef_repo_path, 'chef_repo2')
end
+ it 'knife list --local -Rfp --chef-repo-path chef_repo2 / grabs chef_repo2 stuff' do
+ knife("list --local -Rfp --chef-repo-path #{path_to('chef_repo2')} /").should_succeed <<EOM
+/clients/
+/clients/client3.json
+/cookbooks/
+/cookbooks/cookbook3/
+/cookbooks/cookbook3/metadata.rb
+/data_bags/
+/data_bags/bag3/
+/data_bags/bag3/item3.json
+/environments/
+/environments/env3.json
+/nodes/
+/nodes/node3.json
+/roles/
+/roles/role3.json
+/users/
+/users/user3.json
+EOM
+ end
+
context 'when cwd is at the top level' do
cwd '.'
it 'knife list --local -Rfp fails' do