summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorSean Millichamp <sean.millichamp@secure-24.com>2015-02-14 10:46:34 -0500
committerSean Millichamp <sean.millichamp@secure-24.com>2015-02-14 10:49:26 -0500
commit1321d586a88edb7c8bf07c5edb2d5ce2ae44c1a3 (patch)
tree42096aa0922259f42c774b987884cf16c59bcac6 /spec
parentad5727266a5c243cebf8007b9b00ffc80674b4fc (diff)
(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!
Diffstat (limited to 'spec')
-rwxr-xr-xspec/functions/is_domain_name_spec.rb7
1 files changed, 7 insertions, 0 deletions
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