Make test specific to versions of ruby with String.encode

The code being tested is specific in that way.