require 'support/integration_helper' require 'chef/knife/list_essentials' describe 'knife list' do extend IntegrationSupport include KnifeSupport when_the_chef_server "is empty" do it "knife list / returns all top level directories" do knife('list /').should_succeed < '' } cookbook 'cookbook2', '1.0.1', { 'metadata.rb' => '', 'recipes' => { 'default.rb' => '' } } data_bag 'bag1', { 'item1' => {}, 'item2' => {} } data_bag 'bag2', { 'item1' => {}, 'item2' => {} } environment 'environment1', {} environment 'environment2', {} node 'node1', {} node 'node2', {} role 'role1', {} role 'role2', {} user 'user1', {} user 'user2', {} it "knife list / returns all top level directories" do knife('list /').should_succeed < (Chef::Platform.windows?) do directory 'cookbooks' symlink 'symlinked', 'cookbooks' context 'when cwd is in cookbooks/' do cwd 'cookbooks' it "knife list -Rfp returns cookbooks" do knife('list -Rfp').should_succeed < (Chef::Platform.windows?) do directory 'real_cookbooks' symlink 'cookbooks', 'real_cookbooks' context 'when cwd is in real_cookbooks/' do cwd 'real_cookbooks' it "knife list -Rfp returns cookbooks" do knife('list -Rfp').should_succeed <