From 1321d586a88edb7c8bf07c5edb2d5ce2ae44c1a3 Mon Sep 17 00:00:00 2001 From: Sean Millichamp Date: Sat, 14 Feb 2015 10:46:34 -0500 Subject: (MODULES-1771) Don't modify input to is_domain_name() Fix is_domain_name() so it dup's its incoming argument to avoid changing the original with a later chomp! --- spec/functions/is_domain_name_spec.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'spec/functions/is_domain_name_spec.rb') diff --git a/spec/functions/is_domain_name_spec.rb b/spec/functions/is_domain_name_spec.rb index 4d05f5c..5ab8369 100755 --- a/spec/functions/is_domain_name_spec.rb +++ b/spec/functions/is_domain_name_spec.rb @@ -61,4 +61,11 @@ describe "the is_domain_name function" do result = scope.function_is_domain_name(["not valid"]) expect(result).to(be_falsey) end + + # Values obtained from Facter values will be frozen strings + # in newer versions of Facter: + it "should not throw an exception if passed a frozen string" do + result = scope.function_is_domain_name(["my.domain.name".freeze]) + expect(result).to(be_truthy) + end end -- cgit v1.2.3