2017-02-22 17:29:49 +00:00
|
|
|
|
|
|
|
require 'helper'
|
|
|
|
|
|
|
|
describe BsdMountParser do
|
|
|
|
let (:parser) { Class.new() { include BsdMountParser }.new }
|
|
|
|
|
|
|
|
describe '#parse_mount_options' do
|
|
|
|
it 'parses nil content' do
|
|
|
|
parser.parse_mount_options(nil).must_equal({})
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'parses an empty mount line' do
|
|
|
|
parser.parse_mount_options('').must_equal({})
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'parses a valid mount line' do
|
|
|
|
info = {
|
2019-05-25 10:40:36 +00:00
|
|
|
:device => 'tank/tmp',
|
|
|
|
:type => 'zfs',
|
|
|
|
:options => ['local', 'noexec', 'nosuid', 'nfsv4acls'],
|
2017-02-22 17:29:49 +00:00
|
|
|
}
|
|
|
|
parser.parse_mount_options('tank/tmp on /tmp (zfs, local, noexec, nosuid, nfsv4acls)').must_equal(info)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|