Add #to_s to etc_hosts_allow, and add tests

Signed-off-by: Miah Johnson <miah@chia-pet.org>
This commit is contained in:
Miah Johnson 2019-10-24 12:07:26 -07:00
parent cff6c30a3c
commit ac399b7af9
2 changed files with 10 additions and 0 deletions

View file

@ -33,6 +33,10 @@ module Inspec::Resources
filter.install_filter_methods_on_resource(self, :params)
def to_s
"hosts.allow Configuration"
end
private
def read_content

View file

@ -20,6 +20,9 @@ describe "Inspec::Resources::EtcHostsAllow" do
_(entries.daemon).must_equal %w{vsftpd sshd}
_(entries.client_list).must_include ["127.0.1.154", "[:fff:fAb0::]"]
end
it "has a to_s" do
_(resource.to_s).must_equal "hosts.allow Configuration"
end
end
describe "#parse_line" do
@ -67,5 +70,8 @@ describe "Inspec::Resources::EtcHostsDeny" do
_(entries.daemon).must_equal %w{vsftpd sshd}
_(entries.client_list).must_include ["127.0.1.154", "[:fff:fAb0::]"]
end
it "has a to_s" do
_(resource.to_s).must_equal "hosts.deny Configuration"
end
end
end