summaryrefslogtreecommitdiffstats
path: root/spec/unit/node
diff options
context:
space:
mode:
authorRick Bradley <rick@rickbradley.com>2007-10-04 08:04:44 -0500
committerRick Bradley <rick@rickbradley.com>2007-10-04 08:04:44 -0500
commit92d23e0398ffbaf7e264bb7ff716bd6f83130b07 (patch)
treeaf4a9296a11733c4636a88d38925804ea6f0793d /spec/unit/node
parent1334b786ac622a6094ba68b3e66fce3f5841deed (diff)
parentbd8e38236a23ae687c418fcbb90e5f61c8c67b01 (diff)
downloadpuppet-92d23e0398ffbaf7e264bb7ff716bd6f83130b07.tar.gz
puppet-92d23e0398ffbaf7e264bb7ff716bd6f83130b07.tar.xz
puppet-92d23e0398ffbaf7e264bb7ff716bd6f83130b07.zip
Merge branch 'master' of git://reductivelabs.com/puppet into routing
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")