inspec/test/unit/utils/bsd_mount_parser_test.rb
Ryan Davis 07dc5e3192 First pass at cleaning deprecations for old minitest/spec-style tests.
3 files left to go, and they're behaving oddly so I'm leaving them out
in this pass. Looks like 21 deprecations left.

Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-10-03 13:45:19 -07:00

25 lines
665 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