summaryrefslogtreecommitdiffstats
path: root/test/lib/puppettest
diff options
context:
space:
mode:
authorJesse Wolfe <jes5199@gmail.com>2010-06-15 14:15:16 -0700
committerJesse Wolfe <jes5199@gmail.com>2010-06-21 14:15:25 -0700
commit7c6b8836453b2b1e8679923f98854be3b0022edd (patch)
tree38f3f3af93a3e8b047635cb59a2b2908f885d38f /test/lib/puppettest
parent2396ebac9021eaa4a2983e60902c04cc9e0db0ee (diff)
downloadpuppet-7c6b8836453b2b1e8679923f98854be3b0022edd.tar.gz
puppet-7c6b8836453b2b1e8679923f98854be3b0022edd.tar.xz
puppet-7c6b8836453b2b1e8679923f98854be3b0022edd.zip
[#1621] Composite keys for resources
This patch implements the fundamental pieces of the move to composite keys: * Instead of having a single namevar, we have a non-empty collection of them, and two resources are the same if and only if all of them match. Note that the present situation is a special case of this, where the collection always has exactly one member. * As currently, namevar is determined by the type. * Instead just of inferring the single namevar from the title we let types decompose the title into values for several (perhaps all) of the namevar components; note that the present situation is again a special case of this. Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
Diffstat (limited to 'test/lib/puppettest')
-rw-r--r--test/lib/puppettest/fakes.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/lib/puppettest/fakes.rb b/test/lib/puppettest/fakes.rb
index 0aedb59f6..30387f606 100644
--- a/test/lib/puppettest/fakes.rb
+++ b/test/lib/puppettest/fakes.rb
@@ -9,8 +9,8 @@ module PuppetTest
@name = :fakeresource
end
- def self.namevar
- @realresource.namevar
+ def self.key_attributes
+ @realresource.key_attributes
end
def self.validproperties
@@ -52,7 +52,7 @@ module PuppetTest
@is = {}
@should = {}
@params = {}
- self[@realresource.namevar] = name
+ self[@realresource.key_attributes.first] = name
end
def inspect