Skip to content

Commit

Permalink
Merge pull request #412 from seanmil/MODULES-1771
Browse files Browse the repository at this point in the history
(MODULES-1771) Don't modify input to is_domain_name()
  • Loading branch information
Morgan Haskel committed Feb 19, 2015
2 parents ad57272 + 1321d58 commit fcd2f53
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/puppet/parser/functions/is_domain_name.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module Puppet::Parser::Functions
"given #{arguments.size} for 1")
end

domain = arguments[0]
domain = arguments[0].dup

# Limits (rfc1035, 3.1)
domain_max_length=255
Expand Down
7 changes: 7 additions & 0 deletions spec/functions/is_domain_name_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,11 @@
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

0 comments on commit fcd2f53

Please sign in to comment.