summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2021-09-14 16:21:39 -0700
committerGitHub <noreply@github.com>2021-09-14 16:21:39 -0700
commitce5878a70577171a1ff23517fdd3151d982eefdd (patch)
tree01b4960747fc2084791e760e8c2f657df3089a55 /spec
parent02e653ebc3850615c819388b38d2e533097a52bd (diff)
parent3c7476e6445de29ddb60e6d657e10dd7ab68ce75 (diff)
downloadchef-ce5878a70577171a1ff23517fdd3151d982eefdd.tar.gz
Merge pull request #12022 from jiokmiso/mount_point_coerce
Coerce mount_point only when it is not root directory
Diffstat (limited to 'spec')
-rw-r--r--spec/unit/resource/mount_spec.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/unit/resource/mount_spec.rb b/spec/unit/resource/mount_spec.rb
index c9800f1381..1e1c36a5dd 100644
--- a/spec/unit/resource/mount_spec.rb
+++ b/spec/unit/resource/mount_spec.rb
@@ -59,6 +59,16 @@ describe Chef::Resource::Mount do
expect(resource.mount_point).to eql("//192.168.11.102/Share/backup")
end
+ it "does not strip slash when mount_point is root directory" do
+ resource.mount_point "/"
+ expect(resource.mount_point).to eql("/")
+ end
+
+ it "does not strip slash when mount_point is root of network mount" do
+ resource.mount_point "127.0.0.1:/"
+ expect(resource.mount_point).to eql("127.0.0.1:/")
+ end
+
it "raises error when mount_point property is not set" do
expect { resource.mount_point nil }.to raise_error(Chef::Exceptions::ValidationFailed, "Property mount_point must be one of: String! You passed nil.")
end