Colorize/highlight rails 3 'rake test' output
I already use the redgreen
gem to highlight some test output for rails 3. I enjoy it, but I only found it because I was looking for a more specific solution, which it doesn't have.
I'd like to see the filenames highlighted specifically. I'd like to illustrate with an example:
4) Error:
test_shouldn't_be_able_to_make_duplicate_ModeratorPermission(ModeratorPermissionTest):
NoMethodError: undefined method `users' for #<ModeratorPermissionTest:0x7f13ad7ee3d0>
/test/unit/moderator_permission_test.rb:10:in `test_shouldn't_be_able_to_make_duplicate_ModeratorPermission'
5) Error:
test_*should*_be_able_to_make_duplicate_Post(PostTest):
NoMethodError: undefined method `users' for #<PostTest:0x7f13ad7f04a0>
/test/unit/post_test.rb:12:i开发者_JS百科n `test_*should*_be_able_to_make_duplicate_Post'
6) Error:
test_should_be_able_to_make_a_post(PostTest):
NoMethodError: undefined method `users' for #<PostTest:0x7f13ad7f0478>
/test/unit/post_test.rb:6:in `test_should_be_able_to_make_a_post'
When I first glance at this in black/white, my eyes don't immediately go to any one place. I'd like to see "PostTest" and "ModeratorPermission" highlighted. It'd also be nice if the test name itself was highlighted.
Does anyone know if there's a gem out there that does this already?
Have you tried term-ansicolor?
http://flori.github.com/term-ansicolor/
Or if you are just looking for cleaner output, maybe try turn?
https://github.com/TwP/turn
For a little color on the rake test
output, gem install turn
works with ruby 1.9 and 2.0.
精彩评论