diff options
Diffstat (limited to 'spec/unit/provider/mount_spec.rb')
-rw-r--r-- | spec/unit/provider/mount_spec.rb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/spec/unit/provider/mount_spec.rb b/spec/unit/provider/mount_spec.rb index e9fe3fa050..cc2a456440 100644 --- a/spec/unit/provider/mount_spec.rb +++ b/spec/unit/provider/mount_spec.rb @@ -61,8 +61,19 @@ 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) + allow(provider).to receive(:mount_options_unchanged?).and_return(false) + expect(provider).to receive(:umount_fs).and_return(true) + expect(provider).to receive(:wait_until_unmounted) + 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 |