summaryrefslogtreecommitdiffstats
path: root/spec/integration/parser/compiler_spec.rb
diff options
context:
space:
mode:
authorJesse Wolfe <jes5199@gmail.com>2010-10-04 20:11:56 -0700
committerJesse Wolfe <jes5199@gmail.com>2010-10-04 21:46:59 -0700
commit7bdbd132634f61d91aeee401de15248d936ce71e (patch)
tree146bb43d90478d373f9bb1c5ed3e04bd9d04dbbc /spec/integration/parser/compiler_spec.rb
parent163ec172e06a2b8aab9f9c9247dd45bc0dea3f72 (diff)
parent917c520f1abc0c72d7065531cffcef88259e32e0 (diff)
downloadpuppet-7bdbd132634f61d91aeee401de15248d936ce71e.tar.gz
puppet-7bdbd132634f61d91aeee401de15248d936ce71e.tar.xz
puppet-7bdbd132634f61d91aeee401de15248d936ce71e.zip
Merge commit '2.6.2rc1' into next
Diffstat (limited to 'spec/integration/parser/compiler_spec.rb')
-rwxr-xr-xspec/integration/parser/compiler_spec.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/integration/parser/compiler_spec.rb b/spec/integration/parser/compiler_spec.rb
index df310ac07..f731692b3 100755
--- a/spec/integration/parser/compiler_spec.rb
+++ b/spec/integration/parser/compiler_spec.rb
@@ -27,6 +27,27 @@ describe Puppet::Parser::Compiler do
@compiler.catalog.version.should == version
end
+ it "should not create duplicate resources when a class is referenced both directly and indirectly by the node classifier (4792)" do
+ Puppet[:code] = <<-PP
+ class foo
+ {
+ notify { foo_notify: }
+ include bar
+ }
+ class bar
+ {
+ notify { bar_notify: }
+ }
+ PP
+
+ @node.stubs(:classes).returns(['foo', 'bar'])
+
+ catalog = Puppet::Parser::Compiler.compile(@node)
+
+ catalog.resource("Notify[foo_notify]").should_not be_nil
+ catalog.resource("Notify[bar_notify]").should_not be_nil
+ 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