summaryrefslogtreecommitdiffstats
path: root/spec/unit/node
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2007-10-03 22:29:05 -0500
committerLuke Kanies <luke@madstop.com>2007-10-03 22:29:05 -0500
commit35718437c40ab4228bd58eabf89728b7d0919e50 (patch)
tree9685e3638ec3110599e0d83d876d4738f8667ff2 /spec/unit/node
parentbb3b3cedf4082dc884e41b864fa755057d20e228 (diff)
parentfd11603fe47668ba72f0d3f2b984174331a0a154 (diff)
Merge branch 'master' of ssh://reductivelabs.com/opt/rl/git/puppet
Conflicts: lib/puppet/defaults.rb lib/puppet/dsl.rb
Diffstat (limited to 'spec/unit/node')
-rwxr-xr-xspec/unit/node/configuration.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/unit/node/configuration.rb b/spec/unit/node/configuration.rb
index 8ba55f50c..6893c8581 100755
--- a/spec/unit/node/configuration.rb
+++ b/spec/unit/node/configuration.rb
@@ -68,6 +68,23 @@ describe Puppet::Node::Configuration, " when extracting transobjects" do
Puppet::Parser::Resource.new(:type => type, :title => name, :source => @source, :scope => @scope)
end
+ it "should always create a TransBucket for the 'main' class" do
+ config = Puppet::Node::Configuration.new("mynode")
+
+ @scope = mkscope
+ @source = mock 'source'
+
+ main = mkresource("class", :main)
+ config.add_vertex!(main)
+
+ bucket = mock 'bucket'
+ bucket.expects(:classes=).with(config.classes)
+ main.stubs(:builtin?).returns(false)
+ main.expects(:to_transbucket).returns(bucket)
+
+ config.extract_to_transportable.should equal(bucket)
+ end
+
# This isn't really a spec-style test, but I don't know how better to do it.
it "should transform the resource graph into a tree of TransBuckets and TransObjects" do
config = Puppet::Node::Configuration.new("mynode")