diff options
author | John Keiser <jkeiser@opscode.com> | 2013-10-16 08:37:30 -0700 |
---|---|---|
committer | John Keiser <jkeiser@opscode.com> | 2013-10-16 08:37:30 -0700 |
commit | d320610cdcaca87ba370027523a5b0d221c96f34 (patch) | |
tree | 38ff3fb92d611e9531924b005c4d1b33647e0fd6 /spec/integration/knife | |
parent | cb8845818e9a130d1a85793675aa1216b936d168 (diff) | |
download | chef-d320610cdcaca87ba370027523a5b0d221c96f34.tar.gz |
Prettify data when writing it out in --local-mode
Diffstat (limited to 'spec/integration/knife')
-rw-r--r-- | spec/integration/knife/chef_fs_data_store_spec.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/integration/knife/chef_fs_data_store_spec.rb b/spec/integration/knife/chef_fs_data_store_spec.rb index 72c9f3f045..255a7b66b7 100644 --- a/spec/integration/knife/chef_fs_data_store_spec.rb +++ b/spec/integration/knife/chef_fs_data_store_spec.rb @@ -132,6 +132,7 @@ EOM context 'PUT /TYPE/NAME' do file 'empty.json', {} + file 'rolestuff.json', '{"description":"hi there","name":"x"}' file 'cookbooks_to_upload/x/metadata.rb', "version '1.0.0'\n\n" it 'knife raw -z -i empty.json -m PUT /clients/x' do @@ -171,6 +172,16 @@ EOM knife("raw -z -i #{path_to('empty.json')} -m PUT /users/x").should_succeed /"x"/ knife('list --local /users').should_succeed "/users/x.json\n" end + + it 'After knife raw -z -i rolestuff.json -m PUT /roles/x, the output is pretty', :pending => (RUBY_VERSION < "1.9") do + knife("raw -z -i #{path_to('rolestuff.json')} -m PUT /roles/x").should_succeed /"x"/ + IO.read(path_to('roles/x.json')).should == <<EOM.strip +{ + "name": "x", + "description": "hi there" +} +EOM + end end end @@ -178,6 +189,7 @@ EOM context 'POST /TYPE/NAME' do file 'empty.json', { 'name' => 'z' } file 'empty_id.json', { 'id' => 'z' } + file 'rolestuff.json', '{"description":"hi there","name":"x"}' file 'cookbooks_to_upload/z/metadata.rb', "version '1.0.0'" it 'knife raw -z -i empty.json -m POST /clients' do @@ -222,6 +234,16 @@ EOM knife("raw -z -i #{path_to('empty.json')} -m POST /users").should_succeed /uri/ knife('list --local /users').should_succeed "/users/z.json\n" end + + it 'After knife raw -z -i rolestuff.json -m POST /roles, the output is pretty', :pending => (RUBY_VERSION < "1.9") do + knife("raw -z -i #{path_to('rolestuff.json')} -m POST /roles").should_succeed /uri/ + IO.read(path_to('roles/x.json')).should == <<EOM.strip +{ + "name": "x", + "description": "hi there" +} +EOM + end end it 'knife list -z -R returns nothing' do |