summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorJames Turnbull <james@lovedthanlost.net>2008-05-23 00:51:22 +1000
committerJames Turnbull <james@lovedthanlost.net>2008-05-23 00:51:22 +1000
commit3f35afa802ecc87e34b44f5b23d76621ab145722 (patch)
tree53d9e7fc9253b556cbed3b1fe682d7f5420e85ee /spec
parentd54338f8921b4b2973dcde52576d7e9fa58148cb (diff)
parentc370104f7efa6231af05df17ccbb03cbaa2e48ab (diff)
Merge branch '0.24.x' of git://github.com/lak/puppet into 0.24.x
Diffstat (limited to 'spec')
-rwxr-xr-xspec/unit/node/catalog.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/unit/node/catalog.rb b/spec/unit/node/catalog.rb
index 8178f953a..ff9ab6930 100755
--- a/spec/unit/node/catalog.rb
+++ b/spec/unit/node/catalog.rb
@@ -292,6 +292,26 @@ describe Puppet::Node::Catalog, " when converting to a RAL catalog" do
@catalog.vertices.each { |v| v.catalog.object_id.should equal(@catalog.object_id) }
end
+ it "should convert parser resources to transobjects and set the catalog" do
+ catalog = Puppet::Node::Catalog.new("mynode")
+
+ result = mock 'catalog'
+ result.stub_everything
+
+ Puppet::Node::Catalog.expects(:new).returns result
+
+ trans = mock 'trans'
+ resource = Puppet::Parser::Resource.new(:scope => mock("scope"), :source => mock("source"), :type => :file, :title => "/eh")
+ resource.expects(:to_transobject).returns trans
+ trans.expects(:catalog=).with result
+
+ trans.stub_everything
+
+ catalog.add_resource(resource)
+
+ catalog.to_ral
+ end
+
# This tests #931.
it "should not lose track of resources whose names vary" do
changer = Puppet::TransObject.new 'changer', 'test'