diff options
author | Jesse Wolfe <jes5199@gmail.com> | 2010-07-13 14:01:24 -0700 |
---|---|---|
committer | Markus Roberts <Markus@reality.com> | 2010-07-13 23:09:36 -0700 |
commit | 2edf7fe968ac3d8af9865f65100940747c1fa894 (patch) | |
tree | af448dd1b48af1b75421e56f3f1bb68f86284ca9 /spec/unit/resource_spec.rb | |
parent | 27d5a4782c442908c71bb9abac9f78654581eacf (diff) | |
download | puppet-2edf7fe968ac3d8af9865f65100940747c1fa894.tar.gz puppet-2edf7fe968ac3d8af9865f65100940747c1fa894.tar.xz puppet-2edf7fe968ac3d8af9865f65100940747c1fa894.zip |
[#3656] Serializing arrays of references
My previous fix for #3656 missed the case where a "require" attribute
(or other graph-ish attribute) had multiple values. This patch
generalizes that fix to the multiple-value case.
Diffstat (limited to 'spec/unit/resource_spec.rb')
-rwxr-xr-x | spec/unit/resource_spec.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/unit/resource_spec.rb b/spec/unit/resource_spec.rb index aff3816c2..95f0dd04b 100755 --- a/spec/unit/resource_spec.rb +++ b/spec/unit/resource_spec.rb @@ -687,6 +687,13 @@ describe Puppet::Resource do result = Puppet::Resource.from_pson(PSON.parse(resource.to_pson)) result[:requires].should == "File[/bar]" end + + it "should serialize multiple relationships as arrays of reference strings" do + resource = Puppet::Resource.new("File", "/foo") + resource[:requires] = [Puppet::Resource.new("File", "/bar"), Puppet::Resource.new("File", "/baz")] + result = Puppet::Resource.from_pson(PSON.parse(resource.to_pson)) + result[:requires].should == [ "File[/bar]", "File[/baz]" ] + end end describe "when converting from pson" do |