着色/突出显示轨道 3“rake 测试”输出

发布于 2024-11-08 23:00:27 字数 1013 浏览 0 评论 0原文

我已经使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

一曲爱恨情仇 2024-11-15 23:00:27

您尝试过 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

蓝眸 2024-11-15 23:00:27

为了让 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文