mirror of
https://github.com/inspec/inspec
synced 2024-11-30 08:30:39 +00:00
Add #to_s to etc_hosts_allow, and add tests
Signed-off-by: Miah Johnson <miah@chia-pet.org>
This commit is contained in:
parent
cff6c30a3c
commit
ac399b7af9
2 changed files with 10 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue