summaryrefslogtreecommitdiff
path: root/spec/unit/provider/mount_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/provider/mount_spec.rb')
-rw-r--r--spec/unit/provider/mount_spec.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/spec/unit/provider/mount_spec.rb b/spec/unit/provider/mount_spec.rb
index e9fe3fa050..5647613691 100644
--- a/spec/unit/provider/mount_spec.rb
+++ b/spec/unit/provider/mount_spec.rb
@@ -61,8 +61,17 @@ describe Chef::Provider::Mount do
expect(new_resource).to be_updated_by_last_action
end
- it "should not mount the filesystem if it is mounted" do
+ it "should remount the filesystem if it is mounted and the options have changed" do
allow(current_resource).to receive(:mounted).and_return(true)
+ expect(provider).to receive(:mount_options_unchanged?).and_return(false)
+ expect(provider).to receive(:mount_fs).and_return(true)
+ provider.run_action(:mount)
+ expect(new_resource).to be_updated_by_last_action
+ end
+
+ it "should not mount the filesystem if it is mounted and the options have not changed" do
+ allow(current_resource).to receive(:mounted).and_return(true)
+ expect(provider).to receive(:mount_options_unchanged?).and_return(true)
expect(provider).not_to receive(:mount_fs)
provider.run_action(:mount)
expect(new_resource).not_to be_updated_by_last_action