summaryrefslogtreecommitdiffstats
path: root/spec/integration/parser/compiler_spec.rb
diff options
context:
space:
mode:
authorJesse Wolfe <jes5199@gmail.com>2010-08-12 13:51:14 -0700
committerJesse Wolfe <jes5199@gmail.com>2010-08-12 13:51:14 -0700
commit0f56c1b02d40f1f8552d933dd78b24745937b137 (patch)
tree3c6495838d1b876528cb4522de3484c44749140d /spec/integration/parser/compiler_spec.rb
parentb53e7d78e2e87571ae53170e9716b9ccd75da6e2 (diff)
parent0aa27b5cc5df818e3878601e83f83a20590e161a (diff)
downloadpuppet-0f56c1b02d40f1f8552d933dd78b24745937b137.tar.gz
puppet-0f56c1b02d40f1f8552d933dd78b24745937b137.tar.xz
puppet-0f56c1b02d40f1f8552d933dd78b24745937b137.zip
Merge commit '2.6.1rc2' into next
Diffstat (limited to 'spec/integration/parser/compiler_spec.rb')
-rwxr-xr-xspec/integration/parser/compiler_spec.rb43
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