require 'support/integration_helper' require 'chef/knife/show_essentials' describe 'knife show' do extend IntegrationSupport include KnifeSupport when_the_chef_server "has one of each thing" do client 'x', '{}' cookbook 'x', '1.0.0', { 'metadata.rb' => 'version "1.0.0"' } data_bag 'x', { 'y' => '{}' } environment 'x', '{}' node 'x', '{}' role 'x', '{}' user 'x', '{}' when_the_repository 'also has one of each thing' do file 'clients/x.json', { 'foo' => 'bar' } file 'cookbooks/x/metadata.rb', 'version "1.0.1"' file 'data_bags/x/y.json', { 'foo' => 'bar' } file 'environments/_default.json', { 'foo' => 'bar' } file 'environments/x.json', { 'foo' => 'bar' } file 'nodes/x.json', { 'foo' => 'bar' } file 'roles/x.json', { 'foo' => 'bar' } file 'users/x.json', { 'foo' => 'bar' } it 'knife show /cookbooks/x/metadata.rb shows the remote version' do knife('show /cookbooks/x/metadata.rb').should_succeed < (RUBY_VERSION < "1.9") do knife('show /environments/x.json').should_succeed < (RUBY_VERSION < "1.9") do knife('show /roles/x.json').should_succeed < { 'foo' => 'bar' }, 'cookbook_versions' => { 'blah' => '= 1.0.0'}, 'override_attributes' => { 'x' => 'y' }, 'description' => 'woo', 'name' => 'x' } it 'knife show shows the attributes in a predetermined order', :pending => (RUBY_VERSION < "1.9") do knife('show /environments/x.json').should_succeed <