diff options
author | Luke Kanies <luke@madstop.com> | 2009-03-03 23:20:29 -0600 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2009-03-04 19:26:17 +1100 |
commit | 9577d3af929727ac1e7b5e7e54e4491990d55995 (patch) | |
tree | 0ec94d7a9281093b9cb9392bbd5d12978f6ca857 /spec/unit | |
parent | 719a8df167b7456fe0a1b7b05aff246aa6f73d39 (diff) | |
download | puppet-9577d3af929727ac1e7b5e7e54e4491990d55995.tar.gz puppet-9577d3af929727ac1e7b5e7e54e4491990d55995.tar.xz puppet-9577d3af929727ac1e7b5e7e54e4491990d55995.zip |
Fixing #2013 - prefetching had a mismatch between type and title
The ParsedFile types seem to be the main one that suffers from
this, but the transactions were using the resource titles,
not names, so resources were often not getting prefetched
correctly.
Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'spec/unit')
-rwxr-xr-x | spec/unit/transaction.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/unit/transaction.rb b/spec/unit/transaction.rb index e5ec64054..9122e0eb3 100755 --- a/spec/unit/transaction.rb +++ b/spec/unit/transaction.rb @@ -4,6 +4,21 @@ require File.dirname(__FILE__) + '/../spec_helper' require 'puppet/transaction' +describe Puppet::Transaction do + it "should match resources by name, not title, when prefetching" do + @catalog = Puppet::Node::Catalog.new + @transaction = Puppet::Transaction.new(@catalog) + + # Have both a title and name + resource = Puppet::Type.type(:sshkey).create :title => "foo", :name => "bar", :type => :dsa, :key => "eh" + @catalog.add_resource resource + + resource.provider.class.expects(:prefetch).with("bar" => resource) + + @transaction.prefetch + end +end + describe Puppet::Transaction, " when determining tags" do before do @config = Puppet::Node::Catalog.new |