From d320610cdcaca87ba370027523a5b0d221c96f34 Mon Sep 17 00:00:00 2001 From: John Keiser Date: Wed, 16 Oct 2013 08:37:30 -0700 Subject: Prettify data when writing it out in --local-mode --- spec/integration/knife/chef_fs_data_store_spec.rb | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'spec') 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 == < '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 == <