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') 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 From 2931723bae9e4226ab8eb7f6f806bf9a2ea5cbb8 Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Thu, 7 Feb 2008 15:31:43 -0600 Subject: Fixing the Settings class so that it correctly handles file values that are false. --- spec/unit/util/settings.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'spec') diff --git a/spec/unit/util/settings.rb b/spec/unit/util/settings.rb index f00afd1b7..b44a30eb2 100755 --- a/spec/unit/util/settings.rb +++ b/spec/unit/util/settings.rb @@ -605,6 +605,12 @@ describe Puppet::Util::Settings, " when being used to manage the host machine" d lambda { trans.to_catalog }.should_not raise_error end + it "should ignore file settings whose values are not strings" do + @settings[:maindir] = false + + lambda { trans = @settings.to_transportable }.should_not raise_error + end + it "should be able to turn the current configuration into a parseable manifest" it "should convert octal numbers correctly when producing a manifest" -- cgit