inspec/test/unit/utils/bsd_mount_parser_test.rb
Miah Johnson 0d57612103 Update references to use new namespace
Signed-off-by: Miah Johnson <miah@chia-pet.org>
2020-01-07 15:12:42 -08:00

25 lines
695 B
Ruby

require "helper"
require "inspec/utils/parser"
describe Inspec::Utils::BsdMountParser do
let(:parser) { Class.new { include Inspec::Utils::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