CFINSPEC-94: Refactor belongs_to_group

Signed-off-by: Sonu Saha <sonu.saha@progress.com>
This commit is contained in:
Sonu Saha 2022-03-31 11:51:36 +05:30
parent 2d068bee27
commit 91ffb07901

View file

@ -293,15 +293,7 @@ module Inspec::Resources
# belongs_to_group matcher: compatibility with serverspec # belongs_to_group matcher: compatibility with serverspec
def belongs_to_group?(group_name) def belongs_to_group?(group_name)
groupsname = groups groups.include?(group_name)
is_valid_group = false
groupsname.each do |g|
if g == group_name
is_valid_group = true
break
end
end
is_valid_group
end end
# encrypted_password property: compatibility with serverspec # encrypted_password property: compatibility with serverspec