Issue #3428 has been updated by caleb clausen.

File rdoc_ansi_esc_test.diff added

Sorry for the delay getting back to you on this. Here's a patch which expands test_formatter slightly to exercise the path when output is not a tty. I had hoped to write a high-level black box test, which would be more robust and thorough. But that has proved to be a little more involved than I anticipated.
----------------------------------------
http://redmine.ruby-lang.org/issues/show/3428

----------------------------------------
http://redmine.ruby-lang.org