diff options
Diffstat (limited to 'spec/integration/knife/diff_spec.rb')
-rw-r--r-- | spec/integration/knife/diff_spec.rb | 216 |
1 files changed, 108 insertions, 108 deletions
diff --git a/spec/integration/knife/diff_spec.rb b/spec/integration/knife/diff_spec.rb index 839dcafe49..9e54558300 100644 --- a/spec/integration/knife/diff_spec.rb +++ b/spec/integration/knife/diff_spec.rb @@ -46,18 +46,18 @@ describe "knife diff", :workstation do end it "knife diff reports everything as deleted" do - knife("diff --name-status /").should_succeed <<EOM -D\t/clients/chef-validator.json -D\t/clients/chef-webui.json -D\t/clients/x.json -D\t/cookbooks/x -D\t/data_bags/x -D\t/environments/_default.json -D\t/environments/x.json -D\t/nodes/x.json -D\t/roles/x.json -D\t/users/admin.json -D\t/users/x.json + knife("diff --name-status /").should_succeed <<~EOM + D\t/clients/chef-validator.json + D\t/clients/chef-webui.json + D\t/clients/x.json + D\t/cookbooks/x + D\t/data_bags/x + D\t/environments/_default.json + D\t/environments/x.json + D\t/nodes/x.json + D\t/roles/x.json + D\t/users/admin.json + D\t/users/x.json EOM end end @@ -92,16 +92,16 @@ EOM context "except the role file" do before do - file "roles/x.json", <<EOM -{ - "foo": "bar" -} + file "roles/x.json", <<~EOM + { + "foo": "bar" + } EOM end it "knife diff reports the role as different" do - knife("diff --name-status /").should_succeed <<EOM -M\t/roles/x.json + knife("diff --name-status /").should_succeed <<~EOM + M\t/roles/x.json EOM end end @@ -120,31 +120,31 @@ EOM end it "knife diff reports the new files as added" do - knife("diff --name-status /").should_succeed <<EOM -A\t/clients/y.json -A\t/cookbooks/x/blah.rb -A\t/cookbooks/y -A\t/data_bags/x/z.json -A\t/data_bags/y -A\t/environments/y.json -A\t/nodes/y.json -A\t/roles/y.json -A\t/users/y.json + knife("diff --name-status /").should_succeed <<~EOM + A\t/clients/y.json + A\t/cookbooks/x/blah.rb + A\t/cookbooks/y + A\t/data_bags/x/z.json + A\t/data_bags/y + A\t/environments/y.json + A\t/nodes/y.json + A\t/roles/y.json + A\t/users/y.json EOM end context "when cwd is the data_bags directory" do before { cwd "data_bags" } it "knife diff reports different data bags" do - knife("diff --name-status").should_succeed <<EOM -A\tx/z.json -A\ty + knife("diff --name-status").should_succeed <<~EOM + A\tx/z.json + A\ty EOM end it "knife diff * reports different data bags" do - knife("diff --name-status *").should_succeed <<EOM -A\tx/z.json -A\ty + knife("diff --name-status *").should_succeed <<~EOM + A\tx/z.json + A\ty EOM end end @@ -153,14 +153,14 @@ EOM when_the_repository "is empty" do it "knife diff reports everything as deleted" do - knife("diff --name-status /").should_succeed <<EOM -D\t/clients -D\t/cookbooks -D\t/data_bags -D\t/environments -D\t/nodes -D\t/roles -D\t/users + knife("diff --name-status /").should_succeed <<~EOM + D\t/clients + D\t/cookbooks + D\t/data_bags + D\t/environments + D\t/nodes + D\t/roles + D\t/users EOM end end @@ -179,17 +179,17 @@ EOM end it "knife diff /cookbooks/x shows differences" do - knife("diff --name-status /cookbooks/x").should_succeed <<EOM -M\t/cookbooks/x/metadata.rb -D\t/cookbooks/x/onlyin1.0.1.rb -A\t/cookbooks/x/onlyin1.0.0.rb + knife("diff --name-status /cookbooks/x").should_succeed <<~EOM + M\t/cookbooks/x/metadata.rb + D\t/cookbooks/x/onlyin1.0.1.rb + A\t/cookbooks/x/onlyin1.0.0.rb EOM end it "knife diff --diff-filter=MAT does not show deleted files" do - knife("diff --diff-filter=MAT --name-status /cookbooks/x").should_succeed <<EOM -M\t/cookbooks/x/metadata.rb -A\t/cookbooks/x/onlyin1.0.0.rb + knife("diff --diff-filter=MAT --name-status /cookbooks/x").should_succeed <<~EOM + M\t/cookbooks/x/metadata.rb + A\t/cookbooks/x/onlyin1.0.0.rb EOM end end @@ -210,10 +210,10 @@ EOM end it "knife diff /cookbooks/x shows the differences" do - knife("diff --name-status /cookbooks/x").should_succeed <<EOM -M\t/cookbooks/x/metadata.rb -D\t/cookbooks/x/onlyin1.0.1.rb -A\t/cookbooks/x/onlyin1.0.0.rb + knife("diff --name-status /cookbooks/x").should_succeed <<~EOM + M\t/cookbooks/x/metadata.rb + D\t/cookbooks/x/onlyin1.0.1.rb + A\t/cookbooks/x/onlyin1.0.0.rb EOM end end @@ -224,10 +224,10 @@ EOM end it "knife diff /cookbooks/x shows the differences" do - knife("diff --name-status /cookbooks/x").should_succeed <<EOM -M\t/cookbooks/x/metadata.rb -D\t/cookbooks/x/onlyin0.9.9.rb -A\t/cookbooks/x/onlyin1.0.0.rb + knife("diff --name-status /cookbooks/x").should_succeed <<~EOM + M\t/cookbooks/x/metadata.rb + D\t/cookbooks/x/onlyin0.9.9.rb + A\t/cookbooks/x/onlyin1.0.0.rb EOM end end @@ -341,18 +341,18 @@ EOM end it "knife diff reports everything as deleted" do - knife("diff --name-status /").should_succeed <<EOM -D\t/clients/chef-validator.json -D\t/clients/chef-webui.json -D\t/clients/x.json -D\t/cookbooks/x-1.0.0 -D\t/data_bags/x -D\t/environments/_default.json -D\t/environments/x.json -D\t/nodes/x.json -D\t/roles/x.json -D\t/users/admin.json -D\t/users/x.json + knife("diff --name-status /").should_succeed <<~EOM + D\t/clients/chef-validator.json + D\t/clients/chef-webui.json + D\t/clients/x.json + D\t/cookbooks/x-1.0.0 + D\t/data_bags/x + D\t/environments/_default.json + D\t/environments/x.json + D\t/nodes/x.json + D\t/roles/x.json + D\t/users/admin.json + D\t/users/x.json EOM end end @@ -386,16 +386,16 @@ EOM context "except the role file" do before do - file "roles/x.json", <<EOM -{ - "foo": "bar" -} + file "roles/x.json", <<~EOM + { + "foo": "bar" + } EOM end it "knife diff reports the role as different" do - knife("diff --name-status /").should_succeed <<EOM -M\t/roles/x.json + knife("diff --name-status /").should_succeed <<~EOM + M\t/roles/x.json EOM end end @@ -415,32 +415,32 @@ EOM end it "knife diff reports the new files as added" do - knife("diff --name-status /").should_succeed <<EOM -A\t/clients/y.json -A\t/cookbooks/x-1.0.0/blah.rb -A\t/cookbooks/x-2.0.0 -A\t/cookbooks/y-1.0.0 -A\t/data_bags/x/z.json -A\t/data_bags/y -A\t/environments/y.json -A\t/nodes/y.json -A\t/roles/y.json -A\t/users/y.json + knife("diff --name-status /").should_succeed <<~EOM + A\t/clients/y.json + A\t/cookbooks/x-1.0.0/blah.rb + A\t/cookbooks/x-2.0.0 + A\t/cookbooks/y-1.0.0 + A\t/data_bags/x/z.json + A\t/data_bags/y + A\t/environments/y.json + A\t/nodes/y.json + A\t/roles/y.json + A\t/users/y.json EOM end context "when cwd is the data_bags directory" do before { cwd "data_bags" } it "knife diff reports different data bags" do - knife("diff --name-status").should_succeed <<EOM -A\tx/z.json -A\ty + knife("diff --name-status").should_succeed <<~EOM + A\tx/z.json + A\ty EOM end it "knife diff * reports different data bags" do - knife("diff --name-status *").should_succeed <<EOM -A\tx/z.json -A\ty + knife("diff --name-status *").should_succeed <<~EOM + A\tx/z.json + A\ty EOM end end @@ -449,14 +449,14 @@ EOM when_the_repository "is empty" do it "knife diff reports everything as deleted" do - knife("diff --name-status /").should_succeed <<EOM -D\t/clients -D\t/cookbooks -D\t/data_bags -D\t/environments -D\t/nodes -D\t/roles -D\t/users + knife("diff --name-status /").should_succeed <<~EOM + D\t/clients + D\t/cookbooks + D\t/data_bags + D\t/environments + D\t/nodes + D\t/roles + D\t/users EOM end end @@ -475,8 +475,8 @@ EOM end it "knife diff /cookbooks shows differences" do - knife("diff --name-status /cookbooks").should_succeed <<EOM -D\t/cookbooks/x-1.0.1 + knife("diff --name-status /cookbooks").should_succeed <<~EOM + D\t/cookbooks/x-1.0.1 EOM end @@ -501,9 +501,9 @@ EOM end it "knife diff /cookbooks shows the differences" do - knife("diff --name-status /cookbooks").should_succeed <<EOM -D\t/cookbooks/x-1.0.1 -A\t/cookbooks/x-1.0.0 + knife("diff --name-status /cookbooks").should_succeed <<~EOM + D\t/cookbooks/x-1.0.1 + A\t/cookbooks/x-1.0.0 EOM end end @@ -514,9 +514,9 @@ EOM end it "knife diff /cookbooks shows the differences" do - knife("diff --name-status /cookbooks").should_succeed <<EOM -D\t/cookbooks/x-0.9.9 -A\t/cookbooks/x-1.0.0 + knife("diff --name-status /cookbooks").should_succeed <<~EOM + D\t/cookbooks/x-0.9.9 + A\t/cookbooks/x-1.0.0 EOM end end |