2017-09-23 07:17:34 +00:00
|
|
|
# Custom resource for Utils::FindFIles
|
|
|
|
class TestFindFiles < Inspec.resource(1)
|
2019-06-11 22:24:35 +00:00
|
|
|
name "test_find_files"
|
2017-09-23 07:17:34 +00:00
|
|
|
|
|
|
|
desc "
|
|
|
|
Resource used for testing the funcitonality of Utils::FindFiles
|
|
|
|
"
|
|
|
|
|
|
|
|
example "
|
|
|
|
describe test_find_files('/some/filepath') do
|
|
|
|
its('results') { should include 'somefile.conf' }
|
|
|
|
end
|
|
|
|
"
|
|
|
|
|
2019-06-11 22:24:35 +00:00
|
|
|
require "inspec/utils/find_files"
|
2017-09-23 07:17:34 +00:00
|
|
|
include FindFiles
|
|
|
|
|
|
|
|
attr_reader :results
|
|
|
|
|
|
|
|
def initialize(path)
|
|
|
|
@results = find_files(path)
|
|
|
|
end
|
|
|
|
end
|