diff options
author | Jacob Helwig <jacob@puppetlabs.com> | 2011-03-15 11:25:01 -0700 |
---|---|---|
committer | Jacob Helwig <jacob@puppetlabs.com> | 2011-03-15 11:25:01 -0700 |
commit | a6d0e99e97d18b622793a807e985580cb65a8c7c (patch) | |
tree | 3ff2d3244116fadb2c048e74a6254f90f68ad168 /spec | |
parent | 5d3aa54d86a7b9a2c089b2dbff0778d928853666 (diff) | |
parent | 4c1929952e7239f14aa1ab6a317d445a05d770c3 (diff) | |
download | puppet-a6d0e99e97d18b622793a807e985580cb65a8c7c.tar.gz puppet-a6d0e99e97d18b622793a807e985580cb65a8c7c.tar.xz puppet-a6d0e99e97d18b622793a807e985580cb65a8c7c.zip |
Merge branch 'ticket/2.6.next/5428-handle-0.25.x-storedconfig-data' into 2.6.next
* ticket/2.6.next/5428-handle-0.25.x-storedconfig-data:
Remove extra trailing whitespace from lib/puppet/resource.rb
(#5428) More fully "stub" Puppet::Resource::Reference for use with storedconfigs
Conflicts:
lib/puppet/resource.rb
Diffstat (limited to 'spec')
-rwxr-xr-x | spec/unit/resource_spec.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/unit/resource_spec.rb b/spec/unit/resource_spec.rb index eaa3d5519..345ccd06e 100755 --- a/spec/unit/resource_spec.rb +++ b/spec/unit/resource_spec.rb @@ -463,6 +463,28 @@ describe Puppet::Resource do end end + describe "when loading 0.25.x storedconfigs YAML" do + before :each do + @old_storedconfig_yaml = %q{--- !ruby/object:Puppet::Resource::Reference +builtin_type: +title: /tmp/bar +type: File +} + end + + it "should deserialize a Puppet::Resource::Reference without exceptions" do + lambda { YAML.load(@old_storedconfig_yaml) }.should_not raise_error + end + + it "should deserialize as a Puppet::Resource::Reference as a Puppet::Resource" do + YAML.load(@old_storedconfig_yaml).class.should == Puppet::Resource + end + + it "should to_hash properly" do + YAML.load(@old_storedconfig_yaml).to_hash.should == { :path => "/tmp/bar" } + end + end + describe "when converting to a RAL resource" do it "should use the resource type's :new method to create the resource if the resource is of a builtin type" do resource = Puppet::Resource.new("file", @basepath+"/my/file") |