pairing with luke, nagios_command provider skeleton
[vinpup.git] / spec / unit / ral / type.rb
blob25f8cbaf160547248b9db07f630044121d19e977
1 #!/usr/bin/env ruby
3 require File.dirname(__FILE__) + '/../../spec_helper'
5 describe Puppet::Type, " when in a configuration" do
6     before 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
16     end
18     it "should have no parent if there is no in edge" do
19         @container.parent.should be_nil
20     end
22     it "should set its parent to its in edge" do
23         @one.parent.ref.should == @container.ref
24     end
26     after do
27         @catalog.clear(true)
28     end
29 end