fix(validation): refuse a specs argument that is not a list
This commit is contained in:
@@ -49,6 +49,24 @@
|
||||
fail_msg: "[inputs no-match] got {{ inputs_nomatch_result.msg | default('') }}"
|
||||
success_msg: "[inputs no-match] OK"
|
||||
|
||||
- name: Refuse a spec list given as a string
|
||||
block:
|
||||
- name: Run the validator with specs as a string
|
||||
validate_inputs:
|
||||
specs: "{{ playbook_dir }}/fixture_spec.yml"
|
||||
register: inputs_string_result
|
||||
rescue:
|
||||
- name: Keep the string-specs failure
|
||||
ansible.builtin.set_fact:
|
||||
inputs_string_result: "{{ ansible_failed_result }}"
|
||||
|
||||
- name: Assert the string was refused
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- inputs_string_result.msg is search('specs must be a list')
|
||||
fail_msg: "[inputs string] got {{ inputs_string_result.msg | default('') }}"
|
||||
success_msg: "[inputs string] OK"
|
||||
|
||||
- name: Refuse a variable declared by two specs
|
||||
block:
|
||||
- name: Run the validator with the fixture spec twice
|
||||
|
||||
Reference in New Issue
Block a user