diff options
| author | Jesse Wolfe <jes5199@gmail.com> | 2010-08-02 17:23:36 -0700 |
|---|---|---|
| committer | markus <markus@AVA-351181.(none)> | 2010-08-03 15:19:34 -0700 |
| commit | 1faebdd7b54a55b023f151976644dbc3405c486b (patch) | |
| tree | 5cc6f2cdcd0a0164b9fbd15a03d6e653eb824dff /spec/unit/parser | |
| parent | 37568bdd3f8cc3514eb9d0bf0eae3302686bc13d (diff) | |
| download | puppet-1faebdd7b54a55b023f151976644dbc3405c486b.tar.gz puppet-1faebdd7b54a55b023f151976644dbc3405c486b.tar.xz puppet-1faebdd7b54a55b023f151976644dbc3405c486b.zip | |
[#4423] repair parameterized class instantiation
My earlier #4397 patch was not aware of the parameterized class
instantiation syntax, and failed on manifests that instantiate
parameterized classes.
Diffstat (limited to 'spec/unit/parser')
| -rwxr-xr-x | spec/unit/parser/ast/resource_spec.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/unit/parser/ast/resource_spec.rb b/spec/unit/parser/ast/resource_spec.rb index 58ffae925..5c94ac0e9 100755 --- a/spec/unit/parser/ast/resource_spec.rb +++ b/spec/unit/parser/ast/resource_spec.rb @@ -113,6 +113,13 @@ describe Puppet::Parser::AST::Resource do resource("file").evaluate(@twoscope)[0].type.should == "File" end + it "should correctly generate resources that can look up defined classes by title" do + @scope.known_resource_types.add_hostclass Puppet::Resource::Type.new(:hostclass, "Myresource", {}) + res = resource("class").evaluate(@twoscope)[0] + res.type.should == "Class" + res.title.should == "Myresource" + end + it "should fail for resource types that do not exist" do lambda { resource("nosuchtype").evaluate(@twoscope) }.should raise_error(Puppet::ParseError) end |
