From d4afe39fa1aeb4f4e9d1bcdaf0f924aac2f00584 Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Wed, 3 Oct 2007 17:50:50 -0500 Subject: Fixing #813 -- empty configurations again work. --- spec/unit/node/configuration.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'spec/unit/node') 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") -- cgit From e5c623e6d49704e313bc1a77b6a02ac6c92c7a2b Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Thu, 4 Oct 2007 11:25:36 -0500 Subject: Fixing tests for the Configuration object, since I added the any_failed? test to Transactions. --- spec/unit/node/configuration.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'spec/unit/node') diff --git a/spec/unit/node/configuration.rb b/spec/unit/node/configuration.rb index 6893c8581..6b0677973 100755 --- a/spec/unit/node/configuration.rb +++ b/spec/unit/node/configuration.rb @@ -300,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 @@ -319,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 -- cgit