summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-04-10 23:18:20 -0500
committerLuke Kanies <luke@madstop.com>2008-04-10 23:18:20 -0500
commit2925ad1cb9aa820785afca58c4fb6e34274dadd4 (patch)
treec85393e76e45a04a5d2c413811184f5d4c3f44e5 /test
parent376628d117f43d3319bfa1cc65d54c2d7af10b42 (diff)
downloadpuppet-2925ad1cb9aa820785afca58c4fb6e34274dadd4.tar.gz
puppet-2925ad1cb9aa820785afca58c4fb6e34274dadd4.tar.xz
puppet-2925ad1cb9aa820785afca58c4fb6e34274dadd4.zip
Fixed #1184 -- definitions now autoload correctly all of the time.
Diffstat (limited to 'test')
-rwxr-xr-xtest/language/parser.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/language/parser.rb b/test/language/parser.rb
index 2161a33f5..cdd13297a 100755
--- a/test/language/parser.rb
+++ b/test/language/parser.rb
@@ -1141,7 +1141,6 @@ file { "/tmp/yayness":
name = "sub"
mk_module(modname, :init => %w{separate}, :sub => %w{separate::sub})
- Puppet.err :yay
# First try it with a namespace
klass = parser.findclass("separate", name)
assert_instance_of(AST::HostClass, klass, "Did not autoload sub class from separate file with a namespace")
@@ -1171,6 +1170,14 @@ file { "/tmp/yayness":
klass = parser.findclass("", "alone::sub")
assert_instance_of(AST::HostClass, klass, "Did not autoload sub class from alone file with no namespace")
assert_equal("alone::sub", klass.classname, "Incorrect class was returned")
+
+ # and with the definition in its own file
+ name = "mymod"
+ mk_module(name, :define => true, :mydefine => ["mymod::mydefine"])
+
+ klass = parser.finddefine("", "mymod::mydefine")
+ assert_instance_of(AST::Definition, klass, "Did not autoload definition from its own file")
+ assert_equal("mymod::mydefine", klass.classname, "Incorrect definition was returned")
end
# Make sure class, node, and define methods are case-insensitive