diff options
-rw-r--r-- | lib/puppet/reference/type.rb | 1 | ||||
-rw-r--r-- | lib/puppet/type/whit.rb | 4 | ||||
-rw-r--r-- | spec/unit/type/whit_spec.rb | 11 |
3 files changed, 16 insertions, 0 deletions
diff --git a/lib/puppet/reference/type.rb b/lib/puppet/reference/type.rb index 847bbc223..b423387e9 100644 --- a/lib/puppet/reference/type.rb +++ b/lib/puppet/reference/type.rb @@ -5,6 +5,7 @@ type = Puppet::Util::Reference.newreference :type, :doc => "All Puppet resource Puppet::Type.eachtype { |type| next if type.name == :puppet next if type.name == :component + next if type.name == :whit types[type.name] = type } diff --git a/lib/puppet/type/whit.rb b/lib/puppet/type/whit.rb index 6e5ba9eab..55bfcfb46 100644 --- a/lib/puppet/type/whit.rb +++ b/lib/puppet/type/whit.rb @@ -4,4 +4,8 @@ Puppet::Type.newtype(:whit) do newparam :name do desc "The name of the whit, because it must have one." end + + def to_s + "Class[#{name}]" + end end diff --git a/spec/unit/type/whit_spec.rb b/spec/unit/type/whit_spec.rb new file mode 100644 index 000000000..998d9df30 --- /dev/null +++ b/spec/unit/type/whit_spec.rb @@ -0,0 +1,11 @@ +#!/usr/bin/env ruby + +require File.dirname(__FILE__) + '/../../spec_helper' + +whit = Puppet::Type.type(:whit).new(:name => "Foo::Bar") + +describe whit do + it "should stringify as though it were the class it represents" do + whit.to_s.should == "Class[Foo::Bar]" + end +end |