summaryrefslogtreecommitdiff
path: root/spec/unit/resource/directory_spec.rb
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2018-05-16 12:48:05 -0700
committerTim Smith <tsmith@chef.io>2018-05-16 15:45:33 -0700
commit69687a927da48b169262e3b961fd2c12e6723574 (patch)
treea0744c8401a4ae32ed489c65a3cfd57d3b784b67 /spec/unit/resource/directory_spec.rb
parentb69877bb0f1b2aec99f9c0a392d064e2b0d21bda (diff)
downloadchef-69687a927da48b169262e3b961fd2c12e6723574.tar.gz
Add additional resource specs
Auto generated from the resource inspector Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'spec/unit/resource/directory_spec.rb')
-rw-r--r--spec/unit/resource/directory_spec.rb13
1 files changed, 4 insertions, 9 deletions
diff --git a/spec/unit/resource/directory_spec.rb b/spec/unit/resource/directory_spec.rb
index 778e54ccb6..3dd68211db 100644
--- a/spec/unit/resource/directory_spec.rb
+++ b/spec/unit/resource/directory_spec.rb
@@ -22,22 +22,17 @@ require "spec_helper"
describe Chef::Resource::Directory do
let(:resource) { Chef::Resource::Directory.new("fakey_fakerton") }
- it "has a name property" do
- expect(resource.name).to eql("fakey_fakerton")
+ it "the path property is the name_property" do
+ expect(resource.path).to eql("fakey_fakerton")
end
- it "has a default action of 'create'" do
+ it "sets the default action as :create" do
expect(resource.action).to eql([:create])
end
- it "accepts create or delete for action" do
+ it "supports :create, :delete actions" do
expect { resource.action :create }.not_to raise_error
expect { resource.action :delete }.not_to raise_error
- expect { resource.action :blues }.to raise_error(ArgumentError)
- end
-
- it "uses the object name as the path by default" do
- expect(resource.path).to eql("fakey_fakerton")
end
it "accepts a string as the path" do