summaryrefslogtreecommitdiff
path: root/spec/unit/resource/file_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/resource/file_spec.rb')
-rw-r--r--spec/unit/resource/file_spec.rb20
1 files changed, 10 insertions, 10 deletions
diff --git a/spec/unit/resource/file_spec.rb b/spec/unit/resource/file_spec.rb
index f2dea066ad..438689d737 100644
--- a/spec/unit/resource/file_spec.rb
+++ b/spec/unit/resource/file_spec.rb
@@ -22,14 +22,21 @@ describe Chef::Resource::File do
let(:resource) { Chef::Resource::File.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 "supports :create, :delete, :touch, :create_if_missing actions" do
+ expect { resource.action :create }.not_to raise_error
+ expect { resource.action :delete }.not_to raise_error
+ expect { resource.action :touch }.not_to raise_error
+ expect { resource.action :create_if_missing }.not_to raise_error
+ end
+
it "has a default content of nil" do
expect(resource.content).to be_nil
end
@@ -57,13 +64,6 @@ describe Chef::Resource::File do
expect { resource.checksum "monkey!" }.to raise_error(ArgumentError)
end
- it "accepts create, delete or touch for action" do
- expect { resource.action :create }.not_to raise_error
- expect { resource.action :delete }.not_to raise_error
- expect { resource.action :touch }.not_to raise_error
- expect { resource.action :blues }.to raise_error(ArgumentError)
- end
-
it "accepts a block, symbol, or string for verify" do
expect { resource.verify {} }.not_to raise_error
expect { resource.verify "" }.not_to raise_error