Fix is_domain_name() so it dup's its incoming argument
to avoid changing the original with a later chomp!
"given #{arguments.size} for 1")
end
- domain = arguments[0]
+ domain = arguments[0].dup
# Limits (rfc1035, 3.1)
domain_max_length=255
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