summaryrefslogtreecommitdiffstats
path: root/spec/unit/resource_reference.rb
diff options
context:
space:
mode:
authorPaul Lathrop <paul@tertiusfamily.net>2008-02-05 15:07:05 -0800
committerPaul Lathrop <paul@tertiusfamily.net>2008-02-05 15:07:05 -0800
commitb3f67ec4017940a7eb47f3a044fd77c8d32a74cf (patch)
treef7648cadbbca1d799f773628fc049ad054bae178 /spec/unit/resource_reference.rb
parentaedd59cb2427c8642b817587b0c5ad1319161daa (diff)
downloadpuppet-b3f67ec4017940a7eb47f3a044fd77c8d32a74cf.tar.gz
puppet-b3f67ec4017940a7eb47f3a044fd77c8d32a74cf.tar.xz
puppet-b3f67ec4017940a7eb47f3a044fd77c8d32a74cf.zip
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.
Diffstat (limited to 'spec/unit/resource_reference.rb')
-rwxr-xr-xspec/unit/resource_reference.rb6
1 files changed, 6 insertions, 0 deletions
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