summaryrefslogtreecommitdiff
path: root/spec/unit/provider/mount/linux_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/provider/mount/linux_spec.rb')
-rw-r--r--spec/unit/provider/mount/linux_spec.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/unit/provider/mount/linux_spec.rb b/spec/unit/provider/mount/linux_spec.rb
index 188777a19b..21f45d7fdd 100644
--- a/spec/unit/provider/mount/linux_spec.rb
+++ b/spec/unit/provider/mount/linux_spec.rb
@@ -25,6 +25,7 @@ describe Chef::Provider::Mount::Linux do
allow(::File).to receive(:exists?).with("/dev/sdz1").and_return true
allow(::File).to receive(:exists?).with("/tmp/foo").and_return true
allow(::File).to receive(:exists?).with("//192.168.11.102/Share/backup").and_return true
+ allow(::File).to receive(:exists?).with("//192.168.11.102/Share/backup folder").and_return true
allow(::File).to receive(:realpath).with("/dev/sdz1").and_return "/dev/sdz1"
allow(::File).to receive(:realpath).with("/tmp/foo").and_return "/tmp/foo"
end
@@ -103,6 +104,15 @@ describe Chef::Provider::Mount::Linux do
provider.load_current_resource
expect(provider.current_resource.mounted).to be_truthy
end
+
+ it "should set mounted true if device name has a space and the mount point is found in the mounts list" do
+ new_resource.device "//192.168.11.102/Share/backup folder"
+ new_resource.fstype "cifs"
+ mount = "/tmp/foo //192.168.11.102/Share/backup\x20folder cifs rw\n"
+ allow(provider).to receive(:shell_out!).and_return(double(stdout: mount))
+ provider.load_current_resource
+ expect(provider.current_resource.mounted).to be_truthy
+ end
end
context "to check if loop resource is mounted" do