summaryrefslogtreecommitdiffstats
path: root/lib/puppet/resource
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-12-18 10:57:59 -0600
committerLuke Kanies <luke@madstop.com>2008-12-18 11:10:26 -0600
commit0fc067449a5e6f4941e2dfe232383b94f163b110 (patch)
tree7ee4b5fd9d901f742b85ba8bd394f1b2eea5ae5c /lib/puppet/resource
parente4ba3db1963081eacc2aef3d865f777b427ef23c (diff)
downloadpuppet-0fc067449a5e6f4941e2dfe232383b94f163b110.tar.gz
puppet-0fc067449a5e6f4941e2dfe232383b94f163b110.tar.xz
puppet-0fc067449a5e6f4941e2dfe232383b94f163b110.zip
Fixing all of the test/ tests I broke in previous dev.
Most of these are straightforward changes to the tests, but a couple required small refactorings (e.g., References can now be created with Puppet::Type instances, and they know how to extract the type/title from them). Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'lib/puppet/resource')
-rw-r--r--lib/puppet/resource/reference.rb11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/puppet/resource/reference.rb b/lib/puppet/resource/reference.rb
index 7f33160bd..750c10e41 100644
--- a/lib/puppet/resource/reference.rb
+++ b/lib/puppet/resource/reference.rb
@@ -23,9 +23,14 @@ class Puppet::Resource::Reference
def initialize(argtype, argtitle = nil)
if argtitle.nil?
- self.title = argtype
- if self.title == argtype
- raise ArgumentError, "No title provided and title '%s' is not a valid resource reference" % argtype
+ if argtype.is_a?(Puppet::Type)
+ self.title = argtype.title
+ self.type = argtype.class.name
+ else
+ self.title = argtype
+ if self.title == argtype
+ raise ArgumentError, "No title provided and title '%s' is not a valid resource reference" % argtype.inspect
+ end
end
else
# This will set @type if it looks like a resource reference.