diff options
author | Luke Kanies <luke@puppetlabs.com> | 2010-04-12 14:10:17 -0700 |
---|---|---|
committer | Luke Kanies <luke@puppetlabs.com> | 2010-04-12 14:10:17 -0700 |
commit | 13d141acce03b50f1bfdee2b2a2cba87bcb3da70 (patch) | |
tree | b058c30ccbdfb346320524e2696c67d62b3b4664 /spec/unit/property.rb | |
parent | 66858ef73a538fd8849949b485352c9752bdbe02 (diff) | |
download | puppet-13d141acce03b50f1bfdee2b2a2cba87bcb3da70.tar.gz puppet-13d141acce03b50f1bfdee2b2a2cba87bcb3da70.tar.xz puppet-13d141acce03b50f1bfdee2b2a2cba87bcb3da70.zip |
Fixing Property#change_to_s in rare case failures
If we were removing a field, which really only 'cron'
does, then we got an exception.
This is fixed, and now tested.
Signed-off-by: Luke Kanies <luke@puppetlabs.com>
Diffstat (limited to 'spec/unit/property.rb')
-rwxr-xr-x | spec/unit/property.rb | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/spec/unit/property.rb b/spec/unit/property.rb index 64bad19d1..d99f42a4a 100755 --- a/spec/unit/property.rb +++ b/spec/unit/property.rb @@ -1,4 +1,4 @@ -#!/usr/bin/env ruby" +#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../spec_helper' require 'puppet/property' @@ -399,4 +399,18 @@ describe Puppet::Property do end end end + + describe "when producing a change log" do + it "should say 'defined' when the current value is 'absent'" do + @property.change_to_s(:absent, "foo").should =~ /^defined/ + end + + it "should say 'undefined' when the new value is 'absent'" do + @property.change_to_s("foo", :absent).should =~ /^undefined/ + end + + it "should say 'changed' when neither value is 'absent'" do + @property.change_to_s("foo", "bar").should =~ /changed/ + end + end end |