diff options
| author | Luke Kanies <luke@madstop.com> | 2007-09-15 22:25:54 -0600 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2007-09-15 22:25:54 -0600 |
| commit | b3c8cdb67d9a423a1d14764f1e58f677d7ef8d41 (patch) | |
| tree | 8659134d1de95e0db60aa297e1dde8fcac5b9c82 /spec/unit/node | |
| parent | f17f19dae941b17a56c1fc83ed3a89712b98c427 (diff) | |
| download | puppet-b3c8cdb67d9a423a1d14764f1e58f677d7ef8d41.tar.gz puppet-b3c8cdb67d9a423a1d14764f1e58f677d7ef8d41.tar.xz puppet-b3c8cdb67d9a423a1d14764f1e58f677d7ef8d41.zip | |
Configurations now set a "configuration" instance variable in resources that are inside a configuration, so the resources can interact with the configuration to get things like relationships.
Diffstat (limited to 'spec/unit/node')
| -rwxr-xr-x | spec/unit/node/configuration.rb | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/spec/unit/node/configuration.rb b/spec/unit/node/configuration.rb index 3c30d9b3e..071afc041 100755 --- a/spec/unit/node/configuration.rb +++ b/spec/unit/node/configuration.rb @@ -137,9 +137,9 @@ end describe Puppet::Node::Configuration, " when functioning as a resource container" do before do @config = Puppet::Node::Configuration.new("host") - @one = stub 'resource1', :ref => "Me[you]" - @two = stub 'resource2', :ref => "Me[him]" - @dupe = stub 'resource3', :ref => "Me[you]" + @one = stub 'resource1', :ref => "Me[you]", :configuration= => nil + @two = stub 'resource2', :ref => "Me[him]", :configuration= => nil + @dupe = stub 'resource3', :ref => "Me[you]", :configuration= => nil end it "should make all vertices available by resource reference" do @@ -182,6 +182,11 @@ describe Puppet::Node::Configuration, " when functioning as a resource container conf.add_resource @two end end + + it "should inform the resource that it is the resource's configuration" do + @one.expects(:configuration=).with(@config) + @config.add_resource @one + end end module ApplyingConfigurations @@ -223,7 +228,9 @@ describe Puppet::Node::Configuration, " when applying" do end it "should yield the transaction if a block is provided" do - pending "the code works but is not tested" + @config.apply do |trans| + trans.should equal(@transaction) + end end it "should default to not being a host configuration" do |
