summaryrefslogtreecommitdiff
path: root/spec/unit/provider/remote_directory_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/provider/remote_directory_spec.rb')
-rw-r--r--spec/unit/provider/remote_directory_spec.rb18
1 files changed, 9 insertions, 9 deletions
diff --git a/spec/unit/provider/remote_directory_spec.rb b/spec/unit/provider/remote_directory_spec.rb
index f9559d8827..a845664a0d 100644
--- a/spec/unit/provider/remote_directory_spec.rb
+++ b/spec/unit/provider/remote_directory_spec.rb
@@ -201,17 +201,17 @@ describe Chef::Provider::RemoteDirectory do
@fclass = Chef::CFCCheck.new
Dir.mktmpdir do |tmp_dir|
- begin
- @fclass.file_class.symlink(tmp_dir.dup, symlinked_dir_path)
- expect(::File.exist?(symlinked_dir_path)).to be_truthy
- @provider.run_action
+ @fclass.file_class.symlink(tmp_dir.dup, symlinked_dir_path)
+ expect(::File.exist?(symlinked_dir_path)).to be_truthy
+
+ @provider.run_action
+
+ expect(::File.exist?(symlinked_dir_path)).to be_falsey
+ expect(::File.exist?(tmp_dir)).to be_truthy
+ rescue Chef::Exceptions::Win32APIError
+ skip "This must be run as an Administrator to create symlinks"
- expect(::File.exist?(symlinked_dir_path)).to be_falsey
- expect(::File.exist?(tmp_dir)).to be_truthy
- rescue Chef::Exceptions::Win32APIError
- skip "This must be run as an Administrator to create symlinks"
- end
end
end
end