summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorGavin Reynolds <gavin@chef.io>2019-02-07 14:59:11 +0100
committerTim Smith <tsmith@chef.io>2019-03-04 17:06:38 -0800
commit8d2eec639fac101ad8a5e615c884ed3bc9b7531f (patch)
treeb2a726099b56f13f3c182caeedb691fab2d30b5f /spec
parent23d5fbaa88a67ef8ff8e7b6199d12b2d965b7329 (diff)
downloadchef-8d2eec639fac101ad8a5e615c884ed3bc9b7531f.tar.gz
Ensure that a new blank line `\n\n` is added when appending a new mount point for AIX.
Add existing mount to enable spec Signed-off-by: Gavin Reynolds <gavin@chef.io>
Diffstat (limited to 'spec')
-rw-r--r--spec/unit/provider/mount/aix_spec.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/spec/unit/provider/mount/aix_spec.rb b/spec/unit/provider/mount/aix_spec.rb
index b472e60710..69dd8a3b25 100644
--- a/spec/unit/provider/mount/aix_spec.rb
+++ b/spec/unit/provider/mount/aix_spec.rb
@@ -202,12 +202,20 @@ WRONG
it "should enable mount if it is mounted and not enabled" do
@new_resource.options("nodev,rw")
stub_mounted_enabled(@provider, @mounted_output, "")
+ # Add existing mount to test enable action appends additional mount with seperating blank line
filesystems = StringIO.new
+ filesystems.puts <<~ETCFILESYSTEMS
+ /tmp/abc:
+ dev = /dev/sdz2
+ vfs = jfs2
+ mount = true
+ options = rw
+ ETCFILESYSTEMS
allow(::File).to receive(:open).with("/etc/filesystems", "a").and_yield(filesystems)
@provider.run_action(:enable)
- expect(filesystems.string).to match(%r{^/tmp/foo:\n\tdev\t\t= /dev/sdz1\n\tvfs\t\t= jfs2\n\tmount\t\t= false\n\toptions\t\t= nodev,rw\n$})
+ expect(filesystems.string).to match(%r{^\n\n/tmp/foo:\n\tdev\t\t= /dev/sdz1\n\tvfs\t\t= jfs2\n\tmount\t\t= false\n\toptions\t\t= nodev,rw\n$})
end
it "should not enable mount if it is mounted and already enabled and mount options are unchanged" do