summaryrefslogtreecommitdiffstats
path: root/spec/unit/parser
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2009-08-18 18:14:19 -0700
committerJames Turnbull <james@lovedthanlost.net>2009-08-24 11:38:19 +1000
commit6fa9271a944f4167f82cb51affe1c0b795428b73 (patch)
treef74716eb7c6dd4a1c6e3836d80bf4379625da665 /spec/unit/parser
parentc7526808c9d2d7efbcc39f33112001bd9bd42b56 (diff)
downloadpuppet-6fa9271a944f4167f82cb51affe1c0b795428b73.tar.gz
puppet-6fa9271a944f4167f82cb51affe1c0b795428b73.tar.xz
puppet-6fa9271a944f4167f82cb51affe1c0b795428b73.zip
Fixing #2549 - autoloading of top-level classes works again
This was broken in the recent refactor around autoloading, which didn't special-case classes that specified that they were top-level. Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'spec/unit/parser')
-rwxr-xr-xspec/unit/parser/parser.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/unit/parser/parser.rb b/spec/unit/parser/parser.rb
index ff14e205c..9127599df 100755
--- a/spec/unit/parser/parser.rb
+++ b/spec/unit/parser/parser.rb
@@ -387,6 +387,12 @@ describe Puppet::Parser do
@parser.stubs(:load).returns(false)
@parser.find_or_load("Bogus_namespace","Bogus_name",:my_type).should == false
end
+
+ it "should directly look for fully qualified classes" do
+ @loaded_code.stubs(:find_hostclass).with("foo_namespace","::foo_name").returns(false, true)
+ @parser.expects(:load).with("foo_name").returns true
+ @parser.find_or_load("foo_namespace","::foo_name",:hostclass)
+ end
end
end