summaryrefslogtreecommitdiff
path: root/spec/support/shared/functional/file_resource.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/shared/functional/file_resource.rb')
-rw-r--r--spec/support/shared/functional/file_resource.rb26
1 files changed, 4 insertions, 22 deletions
diff --git a/spec/support/shared/functional/file_resource.rb b/spec/support/shared/functional/file_resource.rb
index bab421d18d..44048598c7 100644
--- a/spec/support/shared/functional/file_resource.rb
+++ b/spec/support/shared/functional/file_resource.rb
@@ -18,45 +18,29 @@
shared_context "deploying with move" do
before do
- @original_atomic_update = Chef::Config[:file_atomic_update]
+ Chef::Config[:file_backup_path] = CHEF_SPEC_BACKUP_PATH
Chef::Config[:file_atomic_update] = true
end
-
- after do
- Chef::Config[:file_atomic_update] = @original_atomic_update
- end
end
shared_context "deploying with copy" do
before do
- @original_atomic_update = Chef::Config[:file_atomic_update]
+ Chef::Config[:file_backup_path] = CHEF_SPEC_BACKUP_PATH
Chef::Config[:file_atomic_update] = false
end
-
- after do
- Chef::Config[:file_atomic_update] = @original_atomic_update
- end
end
shared_context "deploying via tmpdir" do
before do
- @original_stage_via = Chef::Config[:file_staging_uses_destdir]
Chef::Config[:file_staging_uses_destdir] = false
- end
-
- after do
- Chef::Config[:file_staging_uses_destdir] = @original_stage_via
+ Chef::Config[:file_backup_path] = CHEF_SPEC_BACKUP_PATH
end
end
shared_context "deploying via destdir" do
before do
- @original_stage_via = Chef::Config[:file_staging_uses_destdir]
Chef::Config[:file_staging_uses_destdir] = true
- end
-
- after do
- Chef::Config[:file_staging_uses_destdir] = @original_stage_via
+ Chef::Config[:file_backup_path] = CHEF_SPEC_BACKUP_PATH
end
end
@@ -75,7 +59,6 @@ shared_examples_for "a file with the wrong content" do
context "when running action :create" do
context "with backups enabled" do
before do
- Chef::Config[:file_backup_path] = CHEF_SPEC_BACKUP_PATH
resource.run_action(:create)
end
@@ -99,7 +82,6 @@ shared_examples_for "a file with the wrong content" do
context "with backups disabled" do
before do
- Chef::Config[:file_backup_path] = CHEF_SPEC_BACKUP_PATH
resource.backup(0)
resource.run_action(:create)
end