Merge pull request #412 from seanmil/MODULES-1771
(MODULES-1771) Don't modify input to is_domain_name()
This commit is contained in:
commit
fcd2f53908
2 changed files with 8 additions and 1 deletions
|
@ -13,7 +13,7 @@ Returns true if the string passed to this function is a syntactically correct do
|
||||||
"given #{arguments.size} for 1")
|
"given #{arguments.size} for 1")
|
||||||
end
|
end
|
||||||
|
|
||||||
domain = arguments[0]
|
domain = arguments[0].dup
|
||||||
|
|
||||||
# Limits (rfc1035, 3.1)
|
# Limits (rfc1035, 3.1)
|
||||||
domain_max_length=255
|
domain_max_length=255
|
||||||
|
|
|
@ -61,4 +61,11 @@ describe "the is_domain_name function" do
|
||||||
result = scope.function_is_domain_name(["not valid"])
|
result = scope.function_is_domain_name(["not valid"])
|
||||||
expect(result).to(be_falsey)
|
expect(result).to(be_falsey)
|
||||||
end
|
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
|
end
|
||||||
|
|
Loading…
Reference in a new issue