summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Lewis <nick@puppetlabs.com>2011-05-26 13:44:23 -0700
committerNick Lewis <nick@puppetlabs.com>2011-05-26 13:44:23 -0700
commit163ff6b39120815d52811b20ef5f7f46f2fd950f (patch)
treece999b3219533d12cd0d182c2fef5ea1c68f2ed2
parent9f6dec267467334dcc5e1157b9dce57a325cbb73 (diff)
downloadpuppet-163ff6b39120815d52811b20ef5f7f46f2fd950f.tar.gz
(#7681) Add an acceptance test for resource refs with array variables
Paired-with: Jacob Helwig <jacob@puppetlabs.com> Reviewed-by: Dominic Maraglia <dominic@puppetlabs.com>
-rw-r--r--acceptance/tests/language/resource_refs_with_nested_arrays.rb27
1 files changed, 27 insertions, 0 deletions
diff --git a/acceptance/tests/language/resource_refs_with_nested_arrays.rb b/acceptance/tests/language/resource_refs_with_nested_arrays.rb
new file mode 100644
index 000000000..7bc797885
--- /dev/null
+++ b/acceptance/tests/language/resource_refs_with_nested_arrays.rb
@@ -0,0 +1,27 @@
+test_name "#7681: Allow using array variables in resource references"
+
+test_manifest = <<MANIFEST
+$exec_names = ["first", "second"]
+exec { "first":
+ command => "echo the first command",
+ path => "/usr/bin:/bin",
+ logoutput => true,
+}
+exec { "second":
+ command => "echo the second command",
+ path => "/usr/bin:/bin",
+ logoutput => true,
+}
+exec { "third":
+ command => "echo the final command",
+ path => "/usr/bin:/bin",
+ logoutput => true,
+ require => Exec[$exec_names],
+}
+MANIFEST
+
+results = apply_manifest_on agents, test_manifest
+
+results.each do |result|
+ assert_match(/Exec\[third\].*the final command/, "#{result.stdout}")
+end