They were throwing an exception when the 'is' value
was 'absent'.
Signed-off-by: Luke Kanies <[email protected]>
---
lib/puppet/property/list.rb | 6 +++++-
spec/unit/property/list.rb | 4 ++++
2 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/lib/puppet/property/list.rb b/lib/puppet/property/list.rb
index 0c933f1..b7db8b4 100644
--- a/lib/puppet/property/list.rb
+++ b/lib/puppet/property/list.rb
@@ -10,7 +10,11 @@ module Puppet
end
def is_to_s(currentvalue)
- currentvalue.join(delimiter)
+ if currentvalue == :absent
+ return "absent"
+ else
+ return currentvalue.join(delimiter)
+ end
end
def membership
diff --git a/spec/unit/property/list.rb b/spec/unit/property/list.rb
index 2fab868..854ab48 100644
--- a/spec/unit/property/list.rb
+++ b/spec/unit/property/list.rb
@@ -36,6 +36,10 @@ describe list_class do
@property.is_to_s(["foo","bar"]).should == "foo,bar"
end
+ it "should be able to correctly convert ':absent' to a string" do
+ @property.is_to_s(:absent).should == "absent"
+ end
+
describe "when adding should to current" do
it "should add the arrays when current is an array" do
@property.add_should_with_current(["foo"], ["bar"]).should ==
["foo", "bar"]
--
1.6.1
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Puppet Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/puppet-dev?hl=en
-~----------~----~----~----~------~----~------~--~---