diff options
| author | Jesse Wolfe <jes5199@gmail.com> | 2010-07-14 18:26:30 -0700 |
|---|---|---|
| committer | Markus Roberts <Markus@reality.com> | 2010-07-18 19:44:22 -0700 |
| commit | cf597d72dca288011cfa3e57451b8eba56ea51da (patch) | |
| tree | 4160b208bccafb1ecc1258bf1d35b80131fa0dd0 /spec/unit/resource | |
| parent | d6cbb2198e06bb6b8f0172b1a48c9717c7ce6e17 (diff) | |
[#4233] Ruby regexps are not multiline by default, but Resource titles can be multiline
Puppet allows resource titles to contain newlines. We recently
introduced several regexps that were failing on resources with multiline
titles.
Diffstat (limited to 'spec/unit/resource')
| -rwxr-xr-x | spec/unit/resource/catalog_spec.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/unit/resource/catalog_spec.rb b/spec/unit/resource/catalog_spec.rb index b6f96f094..10cff91a3 100755 --- a/spec/unit/resource/catalog_spec.rb +++ b/spec/unit/resource/catalog_spec.rb @@ -1066,4 +1066,13 @@ describe Puppet::Resource::Catalog, "when converting from pson" do lambda { PSON.parse @pson.to_pson }.should raise_error(ArgumentError) end + + describe "#title_key_for_ref" do + it "should parse a resource ref string into a pair" do + @catalog.title_key_for_ref("Title[name]").should == ["Title", "name"] + end + it "should parse a resource ref string into a pair, even if there's a newline inside the name" do + @catalog.title_key_for_ref("Title[na\nme]").should == ["Title", "na\nme"] + end + end end |
