summaryrefslogtreecommitdiffstats
path: root/spec/unit/node
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2007-10-05 00:08:15 -0500
committerLuke Kanies <luke@madstop.com>2007-10-05 00:08:15 -0500
commit275af562b462813ddf5ddbad2192ddc2bf57770c (patch)
treeaceabf68095b8c34fd599f245022a9aaab0984da /spec/unit/node
parentce0178316d8cefd072f53d39b59ce47332f6ec8f (diff)
parent29accba1b9343f4967c15d36506b3bf60d5f0f9c (diff)
downloadpuppet-275af562b462813ddf5ddbad2192ddc2bf57770c.tar.gz
puppet-275af562b462813ddf5ddbad2192ddc2bf57770c.tar.xz
puppet-275af562b462813ddf5ddbad2192ddc2bf57770c.zip
Merge branch 'routing' of http://git.rickbradley.com/puppet into routing
Diffstat (limited to 'spec/unit/node')
-rwxr-xr-xspec/unit/node/configuration.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/unit/node/configuration.rb b/spec/unit/node/configuration.rb
index 8ba55f50c..6b0677973 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")
@@ -283,12 +300,14 @@ describe Puppet::Node::Configuration, " when applying host configurations" do
it "should send a report if reporting is enabled" do
Puppet[:report] = true
@transaction.expects :send_report
+ @transaction.stubs :any_failed? => false
@config.apply
end
it "should send a report if report summaries are enabled" do
Puppet[:summarize] = true
@transaction.expects :send_report
+ @transaction.stubs :any_failed? => false
@config.apply
end
@@ -302,6 +321,7 @@ describe Puppet::Node::Configuration, " when applying host configurations" do
it "should sync the state database after applying" do
Puppet::Util::Storage.expects(:store)
+ @transaction.stubs :any_failed? => false
@config.apply
end