mirror of
https://github.com/ansible-collections/ansible.posix.git
synced 2026-07-29 19:04:46 +00:00
patch - add integration test for ignore_whitespace
This commit is contained in:
@@ -87,3 +87,38 @@
|
||||
dest: '{{ output_dir }}/patch/workfile.txt'
|
||||
register: result
|
||||
failed_when: result is changed
|
||||
|
||||
- name: copy the origin file whitespace
|
||||
copy:
|
||||
src: ./origin.txt
|
||||
dest: '{{ output_dir }}/patch/workfile_whitespace.txt'
|
||||
register: result
|
||||
|
||||
- name: patch the origin file
|
||||
register: result
|
||||
patch:
|
||||
src: result_whitespace.patch
|
||||
dest: '{{ output_dir }}/patch/workfile_whitespace.txt'
|
||||
ignore_whitespace: yes
|
||||
- name: verify patch the origin file
|
||||
assert:
|
||||
that:
|
||||
- result is changed
|
||||
|
||||
- name: test patch the origin file idempotency
|
||||
register: result
|
||||
patch:
|
||||
src: result_whitespace.patch
|
||||
dest: '{{ output_dir }}/patch/workfile_whitespace.txt'
|
||||
ignore_whitespace: yes
|
||||
- name: verify test patch the origin file idempotency
|
||||
assert:
|
||||
that:
|
||||
- result is not changed
|
||||
|
||||
- name: verify the resulted file matches expectations
|
||||
copy:
|
||||
src: ./result_whitespace.txt
|
||||
dest: '{{ output_dir }}/patch/workfile_whitespace.txt'
|
||||
register: result
|
||||
failed_when: result is changed
|
||||
|
||||
Reference in New Issue
Block a user