diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2015-03-02 15:16:56 -0800 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2015-03-05 13:25:24 -0800 |
commit | 7d9696554ec2a9accb66371f23d86a9601ec45e9 (patch) | |
tree | c3f6bcdd0d76772ac0300533ec079246a85c3d83 | |
parent | 0bb2861228fd33fd6a4ef296a1dd223abb6dec9f (diff) | |
download | chef-7d9696554ec2a9accb66371f23d86a9601ec45e9.tar.gz |
add specs for nilling deploy parameters
-rw-r--r-- | spec/functional/resource/deploy_revision_spec.rb | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/spec/functional/resource/deploy_revision_spec.rb b/spec/functional/resource/deploy_revision_spec.rb index e5f5341fcd..bd45e32771 100644 --- a/spec/functional/resource/deploy_revision_spec.rb +++ b/spec/functional/resource/deploy_revision_spec.rb @@ -201,6 +201,41 @@ describe Chef::Resource::DeployRevision, :unix_only => true do end end + describe "setting default parameters to nil" do + before do + FileUtils.mkdir_p(rel_path("releases")) + FileUtils.mkdir_p(rel_path("shared")) + end + + it "supports setting symlink_before_migrate to nil" do + deploy_to_latest_rev.symlink_before_migrate(nil) + expect(deploy_to_latest_rev.symlink_before_migrate).to eql(nil) + deploy_to_latest_rev.run_action(:deploy) + expect(deploy_to_latest_rev).to be_updated_by_last_action + end + + it "supports setting symlinks to nil" do + deploy_to_latest_rev.symlinks(nil) + expect(deploy_to_latest_rev.symlinks).to eql(nil) + deploy_to_latest_rev.run_action(:deploy) + expect(deploy_to_latest_rev).to be_updated_by_last_action + end + + it "supports setting purge_before_symlink to nil" do + deploy_to_latest_rev.purge_before_symlink(nil) + expect(deploy_to_latest_rev.purge_before_symlink).to eql(nil) + deploy_to_latest_rev.run_action(:deploy) + expect(deploy_to_latest_rev).to be_updated_by_last_action + end + + it "supports setting create_dirs_before_symlink to nil" do + deploy_to_latest_rev.create_dirs_before_symlink(nil) + expect(deploy_to_latest_rev.create_dirs_before_symlink).to eql(nil) + deploy_to_latest_rev.run_action(:deploy) + expect(deploy_to_latest_rev).to be_updated_by_last_action + end + end + describe "back to a previously deployed revision, with the directory structure precreated" do before do FileUtils.mkdir_p(rel_path("releases")) |