Closed wdrexler closed 9 years ago
Did you ever figure out how to get tests in for this, @wdrexler?
I can't find a reliable way to test for it. I've tried manually producing a "broken" string using something like this:
require 'tempfile'
str = [212].pack 'c'
str.encoding # => #<Encoding:ASCII-8BIT>
file = Tempfile.new 'x'
file.write str # => 1
According to behavior I'm seeing in the app, the above should raise, but it doesn't. I don't know why.
However, this bug is real, and the fix works, so I'm going to merge this. If we can figure out how to test it later, we can revisit it.
Tests! :facepunch: :tongue: