diff options
author | Luke Kanies <luke@madstop.com> | 2007-09-06 19:24:25 -0500 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2007-09-06 19:24:25 -0500 |
commit | 4104bd3ee9fa146b49aa446fbf4cc3edcdf0974d (patch) | |
tree | dfa1a147f8949c4fd09484979714397c4248f666 /spec/unit/node | |
parent | b7f42441b91c921cd31f3d8c7875ce98bdedf786 (diff) | |
download | puppet-4104bd3ee9fa146b49aa446fbf4cc3edcdf0974d.tar.gz puppet-4104bd3ee9fa146b49aa446fbf4cc3edcdf0974d.tar.xz puppet-4104bd3ee9fa146b49aa446fbf4cc3edcdf0974d.zip |
Fixing #807. The exception handling should more closely resemble how it used to be done.
Diffstat (limited to 'spec/unit/node')
-rwxr-xr-x | spec/unit/node/configuration.rb | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/spec/unit/node/configuration.rb b/spec/unit/node/configuration.rb index 90bc56460..4429fe3a3 100755 --- a/spec/unit/node/configuration.rb +++ b/spec/unit/node/configuration.rb @@ -54,6 +54,16 @@ end describe Puppet::Node::Configuration, " when extracting transobjects" do + def mkscope + @parser = Puppet::Parser::Parser.new :Code => "" + @node = Puppet::Node.new("mynode") + @compile = Puppet::Parser::Compile.new(@node, @parser) + + # XXX This is ridiculous. + @compile.send(:evaluate_main) + @scope = @compile.topscope + end + def mkresource(type, name) Puppet::Parser::Resource.new(:type => type, :title => name, :source => @source, :scope => @scope) end @@ -62,7 +72,7 @@ describe Puppet::Node::Configuration, " when extracting transobjects" do it "should transform the resource graph into a tree of TransBuckets and TransObjects" do config = Puppet::Node::Configuration.new("mynode") - @scope = mock 'scope' + @scope = mkscope @source = mock 'source' defined = mkresource("class", :main) @@ -83,7 +93,7 @@ describe Puppet::Node::Configuration, " when extracting transobjects" do it "should transform arbitrarily deep graphs into isomorphic trees" do config = Puppet::Node::Configuration.new("mynode") - @scope = mock 'scope' + @scope = mkscope @scope.stubs(:tags).returns([]) @source = mock 'source' |