From a8aa8f4b29459e0b46e335835494951721108d55 Mon Sep 17 00:00:00 2001 From: Sonu Saha Date: Wed, 13 Apr 2022 16:53:42 +0530 Subject: [PATCH] CFINSPEC-89: Add unit test for have_gid matcher Signed-off-by: Sonu Saha --- test/unit/resources/group_test.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/unit/resources/group_test.rb b/test/unit/resources/group_test.rb index 3f9c9ad21..a0ac8fcf1 100644 --- a/test/unit/resources/group_test.rb +++ b/test/unit/resources/group_test.rb @@ -130,4 +130,16 @@ describe "Inspec::Resources::Group" do _(resource.exists?).must_equal true _(resource.members).must_equal "" end + + # ubuntu + it "verify have_gid matcher on ubuntu" do + resource = MockLoader.new(:ubuntu).load_resource("group", "root") + _(resource.has_gid?(0)).must_equal true + end + + # freebsd + it "verify have_gid matcher on freebsd" do + resource = MockLoader.new(:freebsd10).load_resource("group", "root") + _(resource.has_gid?(0)).must_equal true + end end