Add functional test to verify no-halt for undeclared inputs

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
This commit is contained in:
Clinton Wolfe 2019-04-30 22:51:56 -04:00
parent c4aa4314af
commit 4773023ef5

View file

@ -106,4 +106,14 @@ describe 'inputs' do
# # TODO - add test for backwards compatibility using 'attribute' in DSL
end
describe 'when using a profile with undeclared (valueless) inputs' do
it 'should warn about them and not abort the run' do
cmd = "exec #{inputs_profiles_path}/undeclared"
result = run_inspec_process(cmd, json: true)
result.stderr.must_include "WARN: Input 'undeclared_01'"
result.stderr.must_include 'does not have a value'
result.must_have_all_controls_passing
end
end
end