diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-05-09 06:01:04 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-05-09 06:01:04 +0000 |
| commit | 9e77e7a95c1c59aca2e7599e0164aef8f3724bf2 (patch) | |
| tree | a0c1931d86c796bfeb74d665e225420f1676507c | |
| parent | 513b87a86e9b77bb9f1b011aa55222ce9cfb3a8d (diff) | |
| download | puppet-9e77e7a95c1c59aca2e7599e0164aef8f3724bf2.tar.gz puppet-9e77e7a95c1c59aca2e7599e0164aef8f3724bf2.tar.xz puppet-9e77e7a95c1c59aca2e7599e0164aef8f3724bf2.zip | |
It is just a snippet test, and thus a functional test but not a coverage test, but definition overrides officially work. This was important because it enables definitions to be collectable, which was not possible without the mechanism that enables this.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1181 980ebf18-57e1-0310-9a29-db15c13687c0
| -rw-r--r-- | examples/code/snippets/defineoverrides.pp | 17 | ||||
| -rwxr-xr-x | test/language/snippets.rb | 6 |
2 files changed, 23 insertions, 0 deletions
diff --git a/examples/code/snippets/defineoverrides.pp b/examples/code/snippets/defineoverrides.pp new file mode 100644 index 000000000..ff598eb69 --- /dev/null +++ b/examples/code/snippets/defineoverrides.pp @@ -0,0 +1,17 @@ +# $Id$ + +$file = "/tmp/defineoverrides1" + +define myfile(mode) { + file { $name: ensure => file, mode => $mode } +} + +class base { + myfile { $file: mode => 644 } +} + +class sub inherits base { + myfile { $file: mode => 755 } +} + +include sub diff --git a/test/language/snippets.rb b/test/language/snippets.rb index 3b1fddd4e..287bc615b 100755 --- a/test/language/snippets.rb +++ b/test/language/snippets.rb @@ -447,6 +447,12 @@ class TestSnippets < Test::Unit::TestCase end end + def snippet_defineoverrides(trans) + file = "/tmp/defineoverrides1" + assert(FileTest.exists?(file), "File does not exist") + assert_equal(0755, filemode(file)) + end + def snippet_emptyclass(trans) # There's nothing to check other than that it works end |
