着色/突出显示导轨3“ rake test”输出

问题描述

| 我已经使用
redgreen
gem突出显示了rails 3的一些测试输出。我很喜欢它,但之所以找到它,是因为我正在寻找更具体的解决方案,而该解决方案没有。 我希望看到文件名特别突出。我想举一个例子来说明:
  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:in `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\'
当我第一次用黑白看时,我的眼睛不会立即移到任何地方。我想看到\“ PostTest \”和\“ ModeratorPermission \”突出显示。如果突出显示了测试名称本身,那就太好了。 有人知道那里是否有宝石吗?     

解决方法

您是否尝试过ansicolor一词? http://flori.github.com/term-ansicolor/ 或者,如果您只是在寻找更清洁的输出,也许尝试转弯? https://github.com/TwP/turn     ,对于
rake test
输出上的少许颜色,
gem install turn
适用于Ruby 1.9和2.0。