From b64a5ff73db9a7350d92b7c376b3f6de152b14d7 Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Tue, 29 Jul 2014 10:43:37 -0500 Subject: [PATCH] Further enhancements for include params tests --- .../roles/test_good_parsing/tasks/main.yml | 32 +++++++++++++++---- .../test_good_parsing/tasks/test_include.yml | 2 +- 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/test/integration/roles/test_good_parsing/tasks/main.yml b/test/integration/roles/test_good_parsing/tasks/main.yml index 2017f13e96..bb87c025c1 100644 --- a/test/integration/roles/test_good_parsing/tasks/main.yml +++ b/test/integration/roles/test_good_parsing/tasks/main.yml @@ -118,18 +118,38 @@ - result.cmd == "echo foo --arg=a --arg=b" - name: test includes with params - include: test_include.yml param={{ test_input }} - register: result + include: test_include.yml fact_name=include_params param="{{ test_input }}" + +- name: assert the include set the correct fact for the param + assert: + that: + - include_params == test_input - name: test includes with quoted params - include: test_include.yml param="this is a param with double quotes" - register: result + include: test_include.yml fact_name=double_quoted_param param="this is a param with double quotes" + +- name: assert the include set the correct fact for the double quoted param + assert: + that: + - double_quoted_param == "this is a param with double quotes" - name: test includes with single quoted params - include: test_include.yml param='this is a param with single quotes' - register: result + include: test_include.yml fact_name=single_quoted_param param='this is a param with single quotes' + +- name: assert the include set the correct fact for the single quoted param + assert: + that: + - single_quoted_param == "this is a param with single quotes" - name: test includes with quoted params in complex args include: test_include.yml vars: + fact_name: complex_param param: "this is a param in a complex arg with double quotes" + +- name: assert the include set the correct fact for the params in complex args + assert: + that: + - complex_param == "this is a param in a complex arg with double quotes" + + diff --git a/test/integration/roles/test_good_parsing/tasks/test_include.yml b/test/integration/roles/test_good_parsing/tasks/test_include.yml index 2526f45b2b..4ba5035805 100644 --- a/test/integration/roles/test_good_parsing/tasks/test_include.yml +++ b/test/integration/roles/test_good_parsing/tasks/test_include.yml @@ -1 +1 @@ -- debug: var=param +- set_fact: "{{fact_name}}='{{param}}'"