diff options
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 |