jstrait / wavefile

A Ruby gem for reading and writing sound files in Wave format (*.wav)
https://wavefilegem.com
MIT License
208 stars 24 forks source link

Frozen Literals - fix tests w/ frozen literals #25

Closed samaaron closed 7 years ago

samaaron commented 7 years ago

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 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.

jstrait commented 7 years ago

@samaaron thanks for finding this! Makes sense, I'll merge and do a gem release.

jstrait commented 7 years ago

@samaaron v0.8.1 has been released, which should include this fix. Let me know if you run into any issues!

samaaron commented 7 years ago

Thanks for this! :-)