summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2007-11-28 11:47:34 -0600
committerLuke Kanies <luke@madstop.com>2007-11-28 11:47:34 -0600
commitc6d1746199c043c833a34393faa10d0a960f201a (patch)
treea492058ef4c018b338765399fae32336bacdd81d /test
parent6c1d8d3bc4f5fddf2da9d48a26fd3b851bdb7d3e (diff)
downloadpuppet-c6d1746199c043c833a34393faa10d0a960f201a.tar.gz
puppet-c6d1746199c043c833a34393faa10d0a960f201a.tar.xz
puppet-c6d1746199c043c833a34393faa10d0a960f201a.zip
Fixing the first half of #917 -- the ResourcReference
AST code now correctly finds the resource. It's getting lost in the configuration translation, though, so I need to fix that, too.
Diffstat (limited to 'test')
-rwxr-xr-xtest/language/ast/resource_reference.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/language/ast/resource_reference.rb b/test/language/ast/resource_reference.rb
index d3b1ffd8f..5a18d3f45 100755
--- a/test/language/ast/resource_reference.rb
+++ b/test/language/ast/resource_reference.rb
@@ -39,6 +39,18 @@ class TestASTResourceReference < Test::Unit::TestCase
end
end
+ def test_finding_classes_for_reference
+ @parser.newclass "one"
+ ref = newref("Class", "one")
+ evaled = nil
+ assert_nothing_raised("Could not evaluate resource ref") do
+ evaled = ref.evaluate(:scope => @scope)
+ end
+
+ assert_equal("class", evaled.type, "Did not set type to 'class'")
+ assert_equal("one", evaled.title, "Did not look up class corectly")
+ end
+
# Related to #706, make sure resource references correctly translate to qualified types.
def test_scoped_references
@parser.newdefine "one"