diff options
-rw-r--r-- | lib/chef/provider/mount/windows.rb | 4 | ||||
-rw-r--r-- | spec/unit/resource/mount_spec.rb | 10 |
2 files changed, 12 insertions, 2 deletions
diff --git a/lib/chef/provider/mount/windows.rb b/lib/chef/provider/mount/windows.rb index 1bd932729d..590b2bfa52 100644 --- a/lib/chef/provider/mount/windows.rb +++ b/lib/chef/provider/mount/windows.rb @@ -40,9 +40,9 @@ class Chef def load_current_resource if is_volume(@new_resource.device) - @mount = Chef::Util::Windows::Volume.new(@new_resource.name) + @mount = Chef::Util::Windows::Volume.new(@new_resource.mount_point) else #assume network drive - @mount = Chef::Util::Windows::NetUse.new(@new_resource.name) + @mount = Chef::Util::Windows::NetUse.new(@new_resource.mount_point) end @current_resource = Chef::Resource::Mount.new(@new_resource.name) diff --git a/spec/unit/resource/mount_spec.rb b/spec/unit/resource/mount_spec.rb index fd81901f45..721f30cf09 100644 --- a/spec/unit/resource/mount_spec.rb +++ b/spec/unit/resource/mount_spec.rb @@ -44,6 +44,16 @@ describe Chef::Resource::Mount do expect(resource.device).to eql("/dev/sdb3") end + it "allows you to set mount_point property" do + resource.mount_point "U:" + expect(resource.mount_point).to eql("U:") + end + + it "raises error when mount_point property is not set" do + resource.mount_point nil + expect { resource.mounted("poop") }.to raise_error(ArgumentError) + end + it "sets fsck_device to '-' by default" do expect(resource.fsck_device).to eql("-") end |