From bd74091ed9845e4ccfd11356ee1aa577dadc86e8 Mon Sep 17 00:00:00 2001 From: = Date: Sun, 24 Apr 2016 17:24:03 +0100 Subject: [PATCH] win_regedit integration test to cover change to allow empty strings to be compared --- .../roles/test_win_regedit/tasks/main.yml | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/test/integration/roles/test_win_regedit/tasks/main.yml b/test/integration/roles/test_win_regedit/tasks/main.yml index 9b69a65af6..361e6f9e81 100644 --- a/test/integration/roles/test_win_regedit/tasks/main.yml +++ b/test/integration/roles/test_win_regedit/tasks/main.yml @@ -349,6 +349,29 @@ that: - "check56_result.changed == true" +# test empty data value (some things depend on this, having no data is not equivalent) + +- name: set an empty data value + win_regedit: + key: HKCU:\Software\Cow Corp + value: helloempty + data: "" + register: check61_result + +- assert: + that: + - "check61_result.changed == true" + +- name: set an empty data value again (should not change) + win_regedit: + key: HKCU:\Software\Cow Corp + value: helloempty + data: "" + register: check62_result + +- assert: + that: + - "check62_result.changed == false" # tear down - name: remove registry key used for testing @@ -356,4 +379,5 @@ key: 'HKCU:\SOFTWARE\Cow Corp' state: absent + # END OF win_regedit tests