着色/突出显示轨道 3“rake 测试”输出
我已经使用 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”突出显示。如果测试名称本身被突出显示,那就太好了。
有谁知道是否有宝石可以做到这一点?
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: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'
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您尝试过 term-ansicolor 吗?
http://flori.github.com/term-ansicolor/
或者如果您只是在寻找为了更干净的输出,也许尝试转动?
https://github.com/TwP/turn
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
为了让
rake test
输出更加生动,gem installturn
适用于 ruby 1.9 和 2.0。For a little color on the
rake test
output,gem install turn
works with ruby 1.9 and 2.0.