The call to String#force_encoding fails due to it attempting to modify
a frozen literal. Instead, create the String with String.new so it is
mutable, modify it and then freeze it after forcing the encoding.
All tests now pass on Ruby 2.4 w/ frozen literals.
When frozen literals are enabled via
--enable-frozen-string-literal
The call to
String#force_encoding
fails due to it attempting to modify a frozen literal. Instead, create the String withString.new
so it is mutable, modify it and then freeze it after forcing the encoding.All tests now pass on Ruby 2.4 w/ frozen literals.