summaryrefslogtreecommitdiff
path: root/spec/unit
diff options
context:
space:
mode:
authorPrajakta Purohit <prajakta@opscode.com>2016-06-13 17:32:52 -0700
committerPrajakta Purohit <prajakta@opscode.com>2016-06-13 17:46:09 -0700
commit225cb72d1f34a8f8e200a81f04f6411e270cc388 (patch)
tree8bc85deb4800c63047cb451b3e3b5e3c67ee5ddc /spec/unit
parent6b9a354728a61a0911c5d89de95a51c42004e74e (diff)
downloadchef-225cb72d1f34a8f8e200a81f04f6411e270cc388.tar.gz
Remote resource should respect sensitive flagpraj/FLOW-334/sensitive
Diffstat (limited to 'spec/unit')
-rw-r--r--spec/unit/provider/remote_directory_spec.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/unit/provider/remote_directory_spec.rb b/spec/unit/provider/remote_directory_spec.rb
index 710d6613fc..b6fd4cfc8e 100644
--- a/spec/unit/provider/remote_directory_spec.rb
+++ b/spec/unit/provider/remote_directory_spec.rb
@@ -99,6 +99,21 @@ describe Chef::Provider::RemoteDirectory do
expect(cookbook_file.owner).to eq("toor")
expect(cookbook_file.backup).to eq(23)
end
+
+ it "respects sensitive flag" do
+ @resource.cookbook "gondola_rides"
+ @resource.sensitive true
+ cookbook_file = @provider.send(:cookbook_file_resource,
+ "/target/destination/path.txt",
+ "relative/source/path.txt")
+ expect(cookbook_file.sensitive).to eq(true)
+
+ @resource.sensitive false
+ cookbook_file = @provider.send(:cookbook_file_resource,
+ "/target/destination/path.txt",
+ "relative/source/path.txt")
+ expect(cookbook_file.sensitive).to eq(false)
+ end
end
describe "when creating the remote directory" do