Skip to content

Commit de21ee2

Browse files
DavidSCiaran McCrisken
authored andcommitted
Workaround a frozen string issue in testing
1 parent cae22b4 commit de21ee2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/puppet/parser/functions/pw_hash.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@
6060
salt = "$#{hash_type}$#{args[2]}"
6161

6262
# handle weak implementations of String#crypt
63-
if 'test'.crypt('$1$1') != '$1$1$Bp8CU9Oujr9SSEw53WV6G.'
63+
# dup the string to get rid of frozen status for testing
64+
if ('test'.dup).crypt('$1$1') != '$1$1$Bp8CU9Oujr9SSEw53WV6G.'
6465
# JRuby < 1.7.17
6566
# MS Windows and other systems that don't support enhanced salts
6667
raise Puppet::ParseError, 'system does not support enhanced salts' unless RUBY_PLATFORM == 'java'

0 commit comments

Comments
 (0)