diff options
| -rw-r--r-- | lib/puppet/transportable.rb | 2 | ||||
| -rwxr-xr-x | spec/unit/other/transobject.rb | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/lib/puppet/transportable.rb b/lib/puppet/transportable.rb index a448e28a5..cf92a3937 100644 --- a/lib/puppet/transportable.rb +++ b/lib/puppet/transportable.rb @@ -24,7 +24,7 @@ module Puppet end def initialize(name,type) - @type = type + @type = type.to_s.downcase @name = name @params = {} @tags = [] diff --git a/spec/unit/other/transobject.rb b/spec/unit/other/transobject.rb index 830d4923d..07ffdf8bd 100755 --- a/spec/unit/other/transobject.rb +++ b/spec/unit/other/transobject.rb @@ -9,6 +9,11 @@ describe Puppet::TransObject do resource = Puppet::TransObject.new("me", "foo::bar") resource.ref.should == 'Foo::Bar[me]' end + + it "should lower-case resource types for backward compatibility with 0.23.2" do + resource = Puppet::TransObject.new("me", "Foo") + resource.type.should == 'foo' + end end describe Puppet::TransObject, " when serializing" do @@ -63,7 +68,7 @@ describe Puppet::TransObject, " when converting to a RAL component instance" do end it "should use a new TransObject whose name is a resource reference of the type and title of the original TransObject" do - Puppet::Type::Component.expects(:create).with { |resource| resource.type == :component and resource.name == "One::Two[/my/file]" }.returns(:yay) + Puppet::Type::Component.expects(:create).with { |resource| resource.type == "component" and resource.name == "One::Two[/my/file]" }.returns(:yay) @resource.to_component.should == :yay end |
