From b3f67ec4017940a7eb47f3a044fd77c8d32a74cf Mon Sep 17 00:00:00 2001 From: Paul Lathrop Date: Tue, 5 Feb 2008 15:07:05 -0800 Subject: Fix ticket 974. My original "fix" wasn't. This actually fixes the problem by using a regular expression that matches only up to the first square bracket. --- spec/unit/resource_reference.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'spec/unit') diff --git a/spec/unit/resource_reference.rb b/spec/unit/resource_reference.rb index ef172d80a..cbbd6ef51 100755 --- a/spec/unit/resource_reference.rb +++ b/spec/unit/resource_reference.rb @@ -40,6 +40,12 @@ describe Puppet::ResourceReference do ref.type.should == "Foo::Bar" ref.title.should == "yay" end + + it "should interpret the title as a reference and assign appropriately if the type is nil and the title contains nested square brackets" do + ref = Puppet::ResourceReference.new(nil, "foo::bar[baz[yay]]") + ref.type.should == "Foo::Bar" + ref.title.should =="baz[yay]" + end end describe Puppet::ResourceReference, "when resolving resources without a catalog" do -- cgit