diff options
Diffstat (limited to 'spec/unit/resource/archive_file_spec.rb')
-rw-r--r-- | spec/unit/resource/archive_file_spec.rb | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/spec/unit/resource/archive_file_spec.rb b/spec/unit/resource/archive_file_spec.rb index 5e44284b66..6effe550db 100644 --- a/spec/unit/resource/archive_file_spec.rb +++ b/spec/unit/resource/archive_file_spec.rb @@ -18,8 +18,11 @@ require "spec_helper" describe Chef::Resource::ArchiveFile do - - let(:resource) { Chef::Resource::ArchiveFile.new("foo") } + let(:node) { Chef::Node.new } + let(:events) { Chef::EventDispatch::Dispatcher.new } + let(:run_context) { Chef::RunContext.new(node, {}, events) } + let(:resource) { Chef::Resource::ArchiveFile.new("foo", run_context) } + let(:provider) { resource.provider_for_action(:extract) } it "has a resource name of :archive_file" do expect(resource.resource_name).to eql(:archive_file) @@ -41,6 +44,12 @@ describe Chef::Resource::ArchiveFile do expect(resource.mode).to eql("755") end + it "mode property throws a deprecation warning if Integers are passed" do + expect(Chef::Log).to receive(:deprecation) + resource.mode 755 + provider.define_resource_requirements + end + it "options property defaults to [:time]" do expect(resource.options).to eql([:time]) end |