summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/unit/file_content_management/deploy/mv_unix_spec.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/spec/unit/file_content_management/deploy/mv_unix_spec.rb b/spec/unit/file_content_management/deploy/mv_unix_spec.rb
index 6c8736ae38..a31074e4bd 100644
--- a/spec/unit/file_content_management/deploy/mv_unix_spec.rb
+++ b/spec/unit/file_content_management/deploy/mv_unix_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Daniel DeLeo (<dan@chef.io>)
-# Copyright:: Copyright 2013-2016, Chef Software Inc.
+# Copyright:: Copyright 2013-2018, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -98,4 +98,16 @@ describe Chef::FileContentManagement::Deploy::MvUnix do
end
end
+
+ describe "when testing against real files", unix_only: true do
+ it "preserves sticky bits" do
+ staging_file = Tempfile.new("staging_file")
+ target_file = Tempfile.new("target_file")
+ File.chmod(04755, target_file.path)
+ content_deployer.deploy(staging_file.path, target_file.path)
+ expect(::File.stat(target_file.path).mode & 07777).to eql(04755)
+ staging_file.unlink
+ target_file.unlink
+ end
+ end
end