diff options
author | Claire McQuin <claire@getchef.com> | 2014-10-29 15:14:22 -0700 |
---|---|---|
committer | Claire McQuin <claire@getchef.com> | 2014-10-29 15:59:04 -0700 |
commit | 5fed7a65a2f024d964ecf2de1bcf2911cf8a600c (patch) | |
tree | 14cc6968e4fe4fd2485c0211088b25c645a80a4b /spec/unit/provider/mount/mount_spec.rb | |
parent | b92c309b0f1aa0837f76ab89d6c81c36076ceca9 (diff) | |
download | chef-5fed7a65a2f024d964ecf2de1bcf2911cf8a600c.tar.gz |
Update to RSpec 3.
Diffstat (limited to 'spec/unit/provider/mount/mount_spec.rb')
-rw-r--r-- | spec/unit/provider/mount/mount_spec.rb | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/spec/unit/provider/mount/mount_spec.rb b/spec/unit/provider/mount/mount_spec.rb index 40cfbcaf39..7e9531a8ac 100644 --- a/spec/unit/provider/mount/mount_spec.rb +++ b/spec/unit/provider/mount/mount_spec.rb @@ -67,14 +67,14 @@ describe Chef::Provider::Mount::Mount do "cifs" => "//cifsserver/share" }.each do |type, fs_spec| it "should detect network fs_spec (#{type})" do @new_resource.device fs_spec - expect(@provider.network_device?).to be_true + expect(@provider.network_device?).to be_truthy end it "should ignore trailing slash and set mounted to true for network mount (#{type})" do @new_resource.device fs_spec allow(@provider).to receive(:shell_out!).and_return(OpenStruct.new(:stdout => "#{fs_spec}/ on /tmp/foo type #{type} (rw)\n")) @provider.load_current_resource - expect(@provider.current_resource.mounted).to be_true + expect(@provider.current_resource.mounted).to be_truthy end end end @@ -123,13 +123,13 @@ describe Chef::Provider::Mount::Mount do it "should set mounted true if the mount point is found in the mounts list" do allow(@provider).to receive(:shell_out!).and_return(OpenStruct.new(:stdout => "/dev/sdz1 on /tmp/foo type ext3 (rw)\n")) @provider.load_current_resource() - expect(@provider.current_resource.mounted).to be_true + expect(@provider.current_resource.mounted).to be_truthy end it "should set mounted false if another mount point beginning with the same path is found in the mounts list" do allow(@provider).to receive(:shell_out!).and_return(OpenStruct.new(:stdout => "/dev/sdz1 on /tmp/foobar type ext3 (rw)\n")) @provider.load_current_resource() - expect(@provider.current_resource.mounted).to be_false + expect(@provider.current_resource.mounted).to be_falsey end it "should set mounted true if the symlink target of the device is found in the mounts list" do @@ -141,7 +141,7 @@ describe Chef::Provider::Mount::Mount do allow(@provider).to receive(:shell_out!).and_return(OpenStruct.new(:stdout => "#{target} on /tmp/foo type ext3 (rw)\n")) @provider.load_current_resource() - expect(@provider.current_resource.mounted).to be_true + expect(@provider.current_resource.mounted).to be_truthy end it "should set mounted true if the symlink target of the device is relative and is found in the mounts list - CHEF-4957" do @@ -155,7 +155,7 @@ describe Chef::Provider::Mount::Mount do allow(@provider).to receive(:shell_out!).and_return(OpenStruct.new(:stdout => "#{absolute_target} on /tmp/foo type ext3 (rw)\n")) @provider.load_current_resource() - expect(@provider.current_resource.mounted).to be_true + expect(@provider.current_resource.mounted).to be_truthy end it "should set mounted true if the mount point is found last in the mounts list" do @@ -164,7 +164,7 @@ describe Chef::Provider::Mount::Mount do allow(@provider).to receive(:shell_out!).and_return(OpenStruct.new(:stdout => mount)) @provider.load_current_resource() - expect(@provider.current_resource.mounted).to be_true + expect(@provider.current_resource.mounted).to be_truthy end it "should set mounted false if the mount point is not last in the mounts list" do @@ -173,13 +173,13 @@ describe Chef::Provider::Mount::Mount do allow(@provider).to receive(:shell_out!).and_return(OpenStruct.new(:stdout => mount)) @provider.load_current_resource() - expect(@provider.current_resource.mounted).to be_false + expect(@provider.current_resource.mounted).to be_falsey end it "mounted should be false if the mount point is not found in the mounts list" do allow(@provider).to receive(:shell_out!).and_return(OpenStruct.new(:stdout => "/dev/sdy1 on /tmp/foo type ext3 (rw)\n")) @provider.load_current_resource() - expect(@provider.current_resource.mounted).to be_false + expect(@provider.current_resource.mounted).to be_falsey end it "should set enabled to true if the mount point is last in fstab" do @@ -189,7 +189,7 @@ describe Chef::Provider::Mount::Mount do allow(::File).to receive(:foreach).with("/etc/fstab").and_yield(fstab1).and_yield(fstab2) @provider.load_current_resource - expect(@provider.current_resource.enabled).to be_true + expect(@provider.current_resource.enabled).to be_truthy end it "should set enabled to true if the mount point is not last in fstab and mount_point is a substring of another mount" do @@ -199,7 +199,7 @@ describe Chef::Provider::Mount::Mount do allow(::File).to receive(:foreach).with("/etc/fstab").and_yield(fstab1).and_yield(fstab2) @provider.load_current_resource - expect(@provider.current_resource.enabled).to be_true + expect(@provider.current_resource.enabled).to be_truthy end it "should set enabled to true if the symlink target is in fstab" do @@ -213,7 +213,7 @@ describe Chef::Provider::Mount::Mount do allow(::File).to receive(:foreach).with("/etc/fstab").and_yield fstab @provider.load_current_resource - expect(@provider.current_resource.enabled).to be_true + expect(@provider.current_resource.enabled).to be_truthy end it "should set enabled to true if the symlink target is relative and is in fstab - CHEF-4957" do @@ -227,7 +227,7 @@ describe Chef::Provider::Mount::Mount do allow(::File).to receive(:foreach).with("/etc/fstab").and_yield fstab @provider.load_current_resource - expect(@provider.current_resource.enabled).to be_true + expect(@provider.current_resource.enabled).to be_truthy end it "should set enabled to false if the mount point is not in fstab" do @@ -235,7 +235,7 @@ describe Chef::Provider::Mount::Mount do allow(::File).to receive(:foreach).with("/etc/fstab").and_yield fstab @provider.load_current_resource - expect(@provider.current_resource.enabled).to be_false + expect(@provider.current_resource.enabled).to be_falsey end it "should ignore commented lines in fstab " do @@ -243,7 +243,7 @@ describe Chef::Provider::Mount::Mount do allow(::File).to receive(:foreach).with("/etc/fstab").and_yield fstab @provider.load_current_resource - expect(@provider.current_resource.enabled).to be_false + expect(@provider.current_resource.enabled).to be_falsey end it "should set enabled to false if the mount point is not last in fstab" do @@ -252,7 +252,7 @@ describe Chef::Provider::Mount::Mount do allow(::File).to receive(:foreach).with("/etc/fstab").and_yield(line_1).and_yield(line_2) @provider.load_current_resource - expect(@provider.current_resource.enabled).to be_false + expect(@provider.current_resource.enabled).to be_falsey end it "should not mangle the mount options if the device in fstab is a symlink" do |