diff options
Diffstat (limited to 'spec/integration/knife/upload_spec.rb')
-rw-r--r-- | spec/integration/knife/upload_spec.rb | 36 |
1 files changed, 9 insertions, 27 deletions
diff --git a/spec/integration/knife/upload_spec.rb b/spec/integration/knife/upload_spec.rb index 2ecbd4e64a..882101130f 100644 --- a/spec/integration/knife/upload_spec.rb +++ b/spec/integration/knife/upload_spec.rb @@ -26,9 +26,7 @@ describe "knife upload", :workstation do include KnifeSupport context "without versioned cookbooks" do - when_the_chef_server "has one of each thing" do - before do client "x", {} cookbook "x", "1.0.0" @@ -80,14 +78,13 @@ Deleted extra entry /roles/x.json (purge is on) Deleted extra entry /users/admin.json (purge is on) Deleted extra entry /users/x.json (purge is on) EOM - knife("diff --name-status /").should_succeed <<EOM + knife("diff --name-status /").should_succeed <<EOM D\t/environments/_default.json EOM end end when_the_repository "has an identical copy of each thing" do - before do file "clients/chef-validator.json", { "validator" => true, "public_key" => ChefZero::PUBLIC_KEY } file "clients/chef-webui.json", { "admin" => true, "public_key" => ChefZero::PUBLIC_KEY } @@ -268,7 +265,6 @@ EOM when_the_chef_server "is empty" do when_the_repository "has a data bag item" do - before do file "data_bags/x/y.json", { "foo" => "bar" } end @@ -292,7 +288,6 @@ EOM end when_the_repository "has a data bag item with keys chef_type and data_bag" do - before do file "data_bags/x/y.json", { "chef_type" => "aaa", "data_bag" => "bbb" } end @@ -329,7 +324,6 @@ EOM end when_the_chef_server "has three data bag items" do - before do data_bag "x", { "deleted" => {}, "modified" => {}, "unmodified" => {} } end @@ -402,7 +396,6 @@ EOM knife("diff --name-status /data_bags").should_succeed "" end context "when cwd is the /data_bags directory" do - before do cwd "data_bags" end @@ -435,7 +428,6 @@ EOM # upload of a file is designed not to work at present. Make sure that is the # case. when_the_chef_server "has a cookbook" do - before do cookbook "x", "1.0.0", { "z.rb" => "" } end @@ -468,7 +460,6 @@ EOM end end when_the_repository "has a missing file for the cookbook" do - before do file "cookbooks/x/metadata.rb", cb_metadata("x", "1.0.0") end @@ -481,7 +472,6 @@ EOM end end when_the_repository "has an extra file for the cookbook" do - before do file "cookbooks/x/metadata.rb", cb_metadata("x", "1.0.0") file "cookbooks/x/z.rb", "" @@ -518,7 +508,6 @@ EOM end when_the_repository "has an update to said cookbook" do - before do file "cookbooks/frozencook/metadata.rb", cb_metadata("frozencook", "1.0.0", "# This is different") end @@ -565,7 +554,7 @@ EOM when_the_chef_server "has an earlier version for the cookbook" do before do - cookbook "x", "1.0.0", { "onlyin1.0.0.rb" => ""} + cookbook "x", "1.0.0", { "onlyin1.0.0.rb" => "" } cookbook "x", "0.9.9", { "onlyin0.9.9.rb" => "hi" } end @@ -667,7 +656,6 @@ EOH end when_the_chef_server "is empty" do - when_the_repository "has an environment with the wrong name in the file" do before do file "environments/x.json", { "name" => "y" } @@ -679,7 +667,6 @@ EOH end when_the_repository "has an environment with no name in the file" do - before do file "environments/x.json", { "description" => "hi" } end @@ -716,7 +703,6 @@ EOM with_versioned_cookbooks do when_the_chef_server "has one of each thing" do - before do client "x", {} cookbook "x", "1.0.0" @@ -811,7 +797,6 @@ EOM end context "except the role file is textually different, but not ACTUALLY different" do - before do file "roles/x.json", <<EOM { @@ -1129,7 +1114,7 @@ EOM when_the_chef_server "has an earlier version for the cookbook" do before do - cookbook "x", "1.0.0", { "onlyin1.0.0.rb" => ""} + cookbook "x", "1.0.0", { "onlyin1.0.0.rb" => "" } cookbook "x", "0.9.9", { "onlyin0.9.9.rb" => "hi" } end it "knife upload /cookbooks uploads the local version" do @@ -1201,7 +1186,6 @@ EOM end when_the_chef_server "is empty" do - when_the_repository "has an environment with the wrong name in the file" do before do file "environments/x.json", { "name" => "y" } @@ -1248,7 +1232,6 @@ EOM end end # with versioned cookbooks - when_the_chef_server "has a user" do before do user "x", {} @@ -1280,7 +1263,6 @@ EOM group "blah", {} when_the_repository "has at least one of each thing" do - before do # TODO We have to upload acls for an existing group due to a lack of # dependency detection during upload. Fix that! @@ -1296,8 +1278,8 @@ EOM file "members.json", [ "bar" ] file "org.json", { "full_name" => "wootles" } file "nodes/x.json", {} - file "policies/x-1.0.0.json", { } - file "policies/blah-1.0.0.json", { } + file "policies/x-1.0.0.json", {} + file "policies/blah-1.0.0.json", {} file "policy_groups/x.json", { "policies" => { "x" => { "revision_id" => "1.0.0" }, "blah" => { "revision_id" => "1.0.0" } } } file "roles/x.json", {} end @@ -1397,9 +1379,9 @@ EOM environment "x", { "description" => "foo" } group "x", { "groups" => [ "admin" ] } node "x", { "run_list" => [ "blah" ] } - policy "x", "1.0.0", { } - policy "x", "1.0.1", { } - policy "y", "1.0.0", { } + policy "x", "1.0.0", {} + policy "x", "1.0.1", {} + policy "y", "1.0.0", {} policy_group "x", { "policies" => { "x" => { "revision_id" => "1.0.1" }, @@ -1443,7 +1425,7 @@ EOM when_the_repository "has an org.json that changes full_name" do before do - file "org.json", { "full_name" => "Something Else"} + file "org.json", { "full_name" => "Something Else" } end it "knife upload / emits a warning for bar and adds foo and foobar" do |