summaryrefslogtreecommitdiff
path: root/spec/unit
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit')
-rw-r--r--spec/unit/knife/cookbook_create_spec.rb1
-rw-r--r--spec/unit/provider/remote_directory_spec.rb15
2 files changed, 16 insertions, 0 deletions
diff --git a/spec/unit/knife/cookbook_create_spec.rb b/spec/unit/knife/cookbook_create_spec.rb
index 5e343f3db1..f860a8bce8 100644
--- a/spec/unit/knife/cookbook_create_spec.rb
+++ b/spec/unit/knife/cookbook_create_spec.rb
@@ -22,6 +22,7 @@ require "tmpdir"
describe Chef::Knife::CookbookCreate do
before(:each) do
Chef::Config[:node_name] = "webmonkey.example.com"
+ Chef::Config[:treat_deprecation_warnings_as_errors] = false
@knife = Chef::Knife::CookbookCreate.new
@knife.config = {}
@knife.name_args = ["foobar"]
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