diff options
| author | Markus Roberts <Markus@reality.com> | 2010-11-15 19:19:02 -0800 |
|---|---|---|
| committer | Markus Roberts <Markus@reality.com> | 2010-11-16 11:10:14 -0800 |
| commit | b2ff6a50202a05f2925fa5046a39ef7f163983f1 (patch) | |
| tree | d2a2d7cb084d0292f8506dc12d490c135d67d6bb /spec/unit/parser | |
| parent | 1ce00dccb840abd9e11432d00c73bdd1de104751 (diff) | |
| download | puppet-b2ff6a50202a05f2925fa5046a39ef7f163983f1.tar.gz puppet-b2ff6a50202a05f2925fa5046a39ef7f163983f1.tar.xz puppet-b2ff6a50202a05f2925fa5046a39ef7f163983f1.zip | |
Fix for #5298 -- Collections need to do type lookup
When the responsibility for type-name resolution was moved to the AST nodes in
commit 449315a2c705df2396852462a1d1e14774b9f117, at least one instance was
missed: the space ship operator
Myclass <<| tag == foo |>>
fails unless Myclass has been previously loaded. This commit adds the lookup
to AST::Collection nodes in the same way it was added to the other node types.
Note that I haven't audited the other note types for similar cases.
Diffstat (limited to 'spec/unit/parser')
| -rwxr-xr-x | spec/unit/parser/ast/collection_spec.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/spec/unit/parser/ast/collection_spec.rb b/spec/unit/parser/ast/collection_spec.rb index 3f7878a99..392a2c0f0 100755 --- a/spec/unit/parser/ast/collection_spec.rb +++ b/spec/unit/parser/ast/collection_spec.rb @@ -5,6 +5,8 @@ require File.dirname(__FILE__) + '/../../../spec_helper' describe Puppet::Parser::AST::Collection do before :each do @scope = stub_everything 'scope' + @mytype = stub_everything('mytype') + @scope.stubs(:find_resource_type).returns @mytype @compiler = stub_everything 'compile' @scope.stubs(:compiler).returns(@compiler) @@ -24,6 +26,8 @@ describe Puppet::Parser::AST::Collection do it "should instantiate a Collector for this type" do collection = Puppet::Parser::AST::Collection.new :form => :virtual, :type => "test" + @test_type = stub 'type', :name => 'test' + @scope.expects(:find_resource_type).with('test').returns @test_type Puppet::Parser::Collector.expects(:new).with(@scope, "test", nil, nil, :virtual) |
