summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsiddheshwar-more <siddheshwar.more@clogeny.com>2015-04-20 21:33:12 +0530
committerLamont Granquist <lamont@scriptkiddie.org>2015-08-18 12:15:44 -0700
commit88b19429cb446c2aba036bfa7bcaed506a2672b9 (patch)
tree93ab8e1f9d0997443cd55fba9855973fe7d9ed72
parent7841cd0a6864600012c2fe43c8483c3baea844e2 (diff)
downloadchef-88b19429cb446c2aba036bfa7bcaed506a2672b9.tar.gz
Added changes to fix aix mount provider related tests according to updated base mount provider
-rw-r--r--spec/unit/provider/mount/aix_spec.rb3
-rw-r--r--spec/unit/provider/mount/mount_spec.rb6
-rw-r--r--spec/unit/provider/mount_spec.rb4
3 files changed, 8 insertions, 5 deletions
diff --git a/spec/unit/provider/mount/aix_spec.rb b/spec/unit/provider/mount/aix_spec.rb
index ca0ddd006c..e232592275 100644
--- a/spec/unit/provider/mount/aix_spec.rb
+++ b/spec/unit/provider/mount/aix_spec.rb
@@ -126,9 +126,10 @@ ENABLED
@provider.run_action(:mount)
end
- it "should not mount resource if it is already mounted" do
+ it "should not mount resource if it is already mounted and the options have not changed" do
stub_mounted_enabled(@provider, @mounted_output, "")
+ allow(@provider).to receive(:mount_options_unchanged?).and_return(true)
expect(@provider).not_to receive(:mount_fs)
@provider.run_action(:mount)
diff --git a/spec/unit/provider/mount/mount_spec.rb b/spec/unit/provider/mount/mount_spec.rb
index ef9031f24b..52556047cb 100644
--- a/spec/unit/provider/mount/mount_spec.rb
+++ b/spec/unit/provider/mount/mount_spec.rb
@@ -326,13 +326,13 @@ describe Chef::Provider::Mount::Mount do
it "should remount the filesystem if it is mounted and the options have changed" do
options = "rw,noexec,noauto"
@new_resource.options(%w{rw exec auto})
- @provider.should_receive(:shell_out!).with("mount -t ext3 -o remount,rw,exec,auto /dev/sdz1 /tmp/foo")
+ expect(@provider).to receive(:shell_out!).with("mount -t ext3 -o remount,rw,exec,auto /dev/sdz1 /tmp/foo")
@provider.mount_fs()
end
it "should not mount the filesystem if it is mounted and the options have not changed" do
- @current_resource.stub(:mounted).and_return(true)
- @provider.should_not_receive(:shell_out!)
+ allow(@current_resource).to receive(:mounted).and_return(true)
+ expect(@provider).to_not receive(:shell_out!)
@provider.mount_fs()
end
diff --git a/spec/unit/provider/mount_spec.rb b/spec/unit/provider/mount_spec.rb
index 5647613691..cc2a456440 100644
--- a/spec/unit/provider/mount_spec.rb
+++ b/spec/unit/provider/mount_spec.rb
@@ -63,7 +63,9 @@ describe Chef::Provider::Mount 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)
+ 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