diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-02-27 23:09:53 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-02-27 23:09:53 +0000 |
| commit | 56116c2aa64ccbbc6740d30b5901b2700bcae036 (patch) | |
| tree | c03cac4bf2eb6ea372bd0476ae388317a0bb2e26 /test | |
| parent | c894eb20ddf812056e897217fd55d31182dbc52f (diff) | |
| download | puppet-56116c2aa64ccbbc6740d30b5901b2700bcae036.tar.gz puppet-56116c2aa64ccbbc6740d30b5901b2700bcae036.tar.xz puppet-56116c2aa64ccbbc6740d30b5901b2700bcae036.zip | |
Fixing bug #73; node names now appear only once in the path
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@955 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test')
| -rwxr-xr-x | test/language/ast.rb | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/test/language/ast.rb b/test/language/ast.rb index fa7d8a651..0c164b64a 100755 --- a/test/language/ast.rb +++ b/test/language/ast.rb @@ -172,9 +172,8 @@ class TestAST < Test::Unit::TestCase scope = nil assert_nothing_raised("Could not evaluate node") { scope = Puppet::Parser::Scope.new() - scope.name = "nodetest" - scope.type = "nodetest" - scope.keyword = "nodetest" + scope.type = "puppet" + scope.name = "top" scope.top = true top.evaluate(:scope => scope) } @@ -210,9 +209,20 @@ class TestAST < Test::Unit::TestCase # of the parent class assert(! scope.lookupclass("parent"), "Found parent class in top scope") + trans = nil # Verify that we can evaluate the node twice assert_nothing_raised("Could not retrieve node definition") { - scope.evalnode(:name => [nodename], :facts => {}) + trans = scope.evalnode(:name => [nodename], :facts => {}) + } + + objects = nil + assert_nothing_raised("Could not convert to objects") { + objects = trans.to_type + } + + Puppet.type(:file).each { |obj| + assert(obj.path !~ /#{nodename}\[#{nodename}\]/, + "Node name appears twice") } end |
