summaryrefslogtreecommitdiffstats
path: root/acceptance/tests/apply/classes/parameterized_classes.rb
diff options
context:
space:
mode:
authorDominic Maraglia <dmaraglia@gmail.com>2011-04-20 14:58:26 -0700
committerDominic Maraglia <dmaraglia@gmail.com>2011-04-20 14:58:26 -0700
commitac428b9557e2da251e4b51e48de844833ca0aa2a (patch)
treeb3ccc5cf1a0dae6e2662dc61855281dc6ba8e8d5 /acceptance/tests/apply/classes/parameterized_classes.rb
parent97e9e5f223cb7baefd52456e2324c592fe415dca (diff)
downloadpuppet-ac428b9557e2da251e4b51e48de844833ca0aa2a.tar.gz
puppet-ac428b9557e2da251e4b51e48de844833ca0aa2a.tar.xz
puppet-ac428b9557e2da251e4b51e48de844833ca0aa2a.zip
Move tests from Puppet-acceptance repo
Diffstat (limited to 'acceptance/tests/apply/classes/parameterized_classes.rb')
-rwxr-xr-xacceptance/tests/apply/classes/parameterized_classes.rb56
1 files changed, 56 insertions, 0 deletions
diff --git a/acceptance/tests/apply/classes/parameterized_classes.rb b/acceptance/tests/apply/classes/parameterized_classes.rb
new file mode 100755
index 000000000..9a7029425
--- /dev/null
+++ b/acceptance/tests/apply/classes/parameterized_classes.rb
@@ -0,0 +1,56 @@
+test_name "parametrized classes"
+
+########################################################################
+step "should allow param classes"
+manifest = %q{
+class x($y, $z) {
+ notice("${y}-${z}")
+}
+class {x: y => '1', z => '2'}
+}
+
+apply_manifest_on(agents, manifest) do
+ fail_test "inclusion after parameterization failed" unless stdout.include? "1-2"
+end
+
+########################################################################
+# REVISIT: This was ported from the old set of tests, but I think that
+# the desired behaviour has recently changed. --daniel 2010-12-23
+step "should allow param class post inclusion"
+manifest = %q{
+class x($y, $z) {
+ notice("${y}-${z}")
+}
+class {x: y => '1', z => '2'}
+include x
+}
+
+apply_manifest_on(agents, manifest) do
+ fail_test "inclusion after parameterization failed" unless stdout.include? "1-2"
+end
+
+########################################################################
+step "should allow param classes defaults"
+manifest = %q{
+class x($y, $z='2') {
+ notice("${y}-${z}")
+}
+class {x: y => '1'}
+}
+
+apply_manifest_on(agents, manifest) do
+ fail_test "the default didn't apply as expected" unless stdout.include? "1-2"
+end
+
+########################################################################
+step "should allow param class defaults to be overriden"
+manifest = %q{
+class x($y, $z='2') {
+ notice("${y}-${z}")
+}
+class {x: y => '1', z => '3'}
+}
+
+apply_manifest_on(agents, manifest) do
+ fail_test "the override didn't happen as we expected" unless stdout.include? "1-3"
+end