inspec/test/unit/utils/bsd_mount_parser_test.rb
Miah Johnson e46018a517 chefstyle -a cleanup
Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-06-11 18:52:38 -07:00

25 lines
658 B
Ruby

require "helper"
require "inspec/utils/parser"
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 = {
device: "tank/tmp",
type: "zfs",
options: %w{local noexec nosuid nfsv4acls},
}
parser.parse_mount_options("tank/tmp on /tmp (zfs, local, noexec, nosuid, nfsv4acls)").must_equal(info)
end
end
end