diff options
author | Thom May <thom@may.lt> | 2016-12-01 21:18:11 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-01 21:18:11 +0000 |
commit | 76dd752ac2641faf4c24c802762a3b9970882a8c (patch) | |
tree | 70f64763f0edadec978d06514486a4a6e24eb221 /spec | |
parent | 12c7d21e439ef23a5f77cf276f98edfa3e477c80 (diff) | |
parent | 937faa7e42c6df03b1deec0e8bbc785b7ba33e90 (diff) | |
download | chef-76dd752ac2641faf4c24c802762a3b9970882a8c.tar.gz |
Merge pull request #5599 from shortdudey123/mount_action_unmount
Alias unmount to umount for mount resource
Diffstat (limited to 'spec')
-rw-r--r-- | spec/unit/provider/mount_spec.rb | 7 | ||||
-rw-r--r-- | spec/unit/resource/mount_spec.rb | 3 |
2 files changed, 9 insertions, 1 deletions
diff --git a/spec/unit/provider/mount_spec.rb b/spec/unit/provider/mount_spec.rb index 19967e8496..b2497cf1b2 100644 --- a/spec/unit/provider/mount_spec.rb +++ b/spec/unit/provider/mount_spec.rb @@ -70,6 +70,13 @@ describe Chef::Provider::Mount do expect(new_resource).to be_updated_by_last_action end + it "should unmount the filesystem if it is mounted" do + allow(current_resource).to receive(:mounted).and_return(true) + expect(provider).to receive(:umount_fs).and_return(true) + provider.run_action(:unmount) + expect(new_resource).to be_updated_by_last_action + end + it "should not umount the filesystem if it is not mounted" do allow(current_resource).to receive(:mounted).and_return(false) expect(provider).not_to receive(:umount_fs) diff --git a/spec/unit/resource/mount_spec.rb b/spec/unit/resource/mount_spec.rb index 188eaa67d6..832f7644ac 100644 --- a/spec/unit/resource/mount_spec.rb +++ b/spec/unit/resource/mount_spec.rb @@ -41,9 +41,10 @@ describe Chef::Resource::Mount do expect(@resource.action).to eql([:mount]) end - it "should accept mount, umount and remount as actions" do + it "should accept mount, umount, unmount and remount as actions" do expect { @resource.action :mount }.not_to raise_error expect { @resource.action :umount }.not_to raise_error + expect { @resource.action :unmount }.not_to raise_error expect { @resource.action :remount }.not_to raise_error expect { @resource.action :brooklyn }.to raise_error(ArgumentError) end |