diff options
author | Jesse Wolfe <jes5199@gmail.com> | 2010-08-12 13:53:13 -0700 |
---|---|---|
committer | Jesse Wolfe <jes5199@gmail.com> | 2010-08-12 13:53:29 -0700 |
commit | 1f3070c4bc77b38e3dd6170cf6a58bee7ec337ac (patch) | |
tree | 3c6495838d1b876528cb4522de3484c44749140d /spec/integration/parser/compiler_spec.rb | |
parent | d5db8db116aff58215ab0feebd7ec02086040f51 (diff) | |
parent | 0f56c1b02d40f1f8552d933dd78b24745937b137 (diff) | |
download | puppet-1f3070c4bc77b38e3dd6170cf6a58bee7ec337ac.tar.gz puppet-1f3070c4bc77b38e3dd6170cf6a58bee7ec337ac.tar.xz puppet-1f3070c4bc77b38e3dd6170cf6a58bee7ec337ac.zip |
Merge branch 'next'
This synchronizes the 2.7 master branch with 2.6.1RC2
Diffstat (limited to 'spec/integration/parser/compiler_spec.rb')
-rwxr-xr-x | spec/integration/parser/compiler_spec.rb | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/spec/integration/parser/compiler_spec.rb b/spec/integration/parser/compiler_spec.rb index 83bbf9500..9158ad1c2 100755 --- a/spec/integration/parser/compiler_spec.rb +++ b/spec/integration/parser/compiler_spec.rb @@ -26,4 +26,47 @@ describe Puppet::Parser::Compiler do @compiler.catalog.version.should == version end + + describe "when resolving class references" do + it "should favor local scope, even if there's an included class in topscope" do + Puppet[:code] = <<-PP + class experiment { + class baz { + } + notify {"x" : require => Class[Baz] } + } + class baz { + } + include baz + include experiment + include experiment::baz + PP + + catalog = Puppet::Parser::Compiler.compile(Puppet::Node.new("mynode")) + + notify_resource = catalog.resource( "Notify[x]" ) + + notify_resource[:require].title.should == "Experiment::Baz" + end + + it "should favor local scope, even if there's an unincluded class in topscope" do + Puppet[:code] = <<-PP + class experiment { + class baz { + } + notify {"x" : require => Class[Baz] } + } + class baz { + } + include experiment + include experiment::baz + PP + + catalog = Puppet::Parser::Compiler.compile(Puppet::Node.new("mynode")) + + notify_resource = catalog.resource( "Notify[x]" ) + + notify_resource[:require].title.should == "Experiment::Baz" + end + end end |