summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorBrice Figureau <brice-puppet@daysofwonder.com>2010-04-24 13:47:00 +0200
committerMarkus Roberts <Markus@reality.com>2010-06-28 14:17:56 -0700
commit770a8ea2beb58cff52f5e532a777d7046aa2efb0 (patch)
tree3bd0448cf17e075e48322e245389d556278d84d9 /spec
parent76953d818892506ec4cb3ab2c4dd7048364a08cd (diff)
downloadpuppet-770a8ea2beb58cff52f5e532a777d7046aa2efb0.tar.gz
puppet-770a8ea2beb58cff52f5e532a777d7046aa2efb0.tar.xz
puppet-770a8ea2beb58cff52f5e532a777d7046aa2efb0.zip
Fix #3665 - main class shouldn't be a subscope of itself
During the refactoring of AST hostclass/node to non AST objects, we lost the fact that the main class already comes with a scope (ie the top one), so when we evaluate its code we shouldn't create a subscope for it. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
Diffstat (limited to 'spec')
-rwxr-xr-xspec/unit/resource/type_spec.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/unit/resource/type_spec.rb b/spec/unit/resource/type_spec.rb
index fdb81f760..781721d84 100755
--- a/spec/unit/resource/type_spec.rb
+++ b/spec/unit/resource/type_spec.rb
@@ -412,6 +412,14 @@ describe Puppet::Resource::Type do
@type.evaluate_code(@resource)
end
+ it "should not create a subscope for the :main class" do
+ @resource.stubs(:title).returns(:main)
+ @type.expects(:subscope).never
+ @type.expects(:set_resource_parameters).with(@resource, @scope)
+
+ @type.evaluate_code(@resource)
+ end
+
it "should store the class scope" do
@type.evaluate_code(@resource)
@scope.class_scope(@type).should be_instance_of(@scope.class)