summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2015-03-02 15:16:56 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2015-03-05 13:25:24 -0800
commit7d9696554ec2a9accb66371f23d86a9601ec45e9 (patch)
treec3f6bcdd0d76772ac0300533ec079246a85c3d83
parent0bb2861228fd33fd6a4ef296a1dd223abb6dec9f (diff)
downloadchef-7d9696554ec2a9accb66371f23d86a9601ec45e9.tar.gz
add specs for nilling deploy parameters
-rw-r--r--spec/functional/resource/deploy_revision_spec.rb35
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"))