Last Updated: 2024-03-02
I had a feature that was tested in my specs against
.txt files that contained
text data. This same feature, however, was expected to work with binary data in
production. Sure enough, it failed with encoding errors in production, due to
the file not being opened with the
b (for binary) flag.
When testing an application that reads files, test against the appropriate category of data (binary vs. text), as you expect to receive.