3 require File.dirname(__FILE__) + '/../../spec_helper'
5 describe Puppet::Type, " when in a configuration" do
7 @catalog = Puppet::Node::Catalog.new
8 @container = Puppet::Type.type(:component).create(:name => "container")
9 @one = Puppet::Type.type(:file).create(:path => "/file/one")
10 @two = Puppet::Type.type(:file).create(:path => "/file/two")
11 @catalog.add_resource @container
12 @catalog.add_resource @one
13 @catalog.add_resource @two
14 @catalog.add_edge! @container, @one
15 @catalog.add_edge! @container, @two
18 it "should have no parent if there is no in edge" do
19 @container.parent.should be_nil
22 it "should set its parent to its in edge" do
23 @one.parent.ref.should == @container.ref