rubymine 只能一项一项地运行模型测试

发布于 2024-12-06 05:27:19 字数 156 浏览 6 评论 0原文

我可以右键单击 3 个规范/模型中的任何一个,但是当我右键单击 spec/models 文件夹并选择“运行模型中的所有测试”时,我得到“无法将测试报告器附加到测试框架”。 我的模型测试的第一行是: require 'spec_helper.rb'

I am able to right-click on any of my 3 spec/models but when I right click the spec/models folder and select 'run all tests in models' I get 'Unable to attach test reporter to test framework'.
The first line of my model tests is: require 'spec_helper.rb'

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(3

舟遥客 2024-12-13 05:27:19

我发布了这个答案另一个问题。它也可能对这个问题有所帮助:

在我的系统上,问题是“红绿”宝石。它根据成功或失败自动为进度标记(点)和 Test::Unit 摘要消息着色。 RubyMine 中一定有某些东西正在尝试解析 Test::Unit 结果(我想是“rake test”的输出),并且它被 ANSI 序列阻塞了。

我在 test/test_helper.rb 中注释掉了“require 'redgreen'”,问题就消失了。不过,我真的很喜欢 redgreen 从 shell 执行“rake 测试”,所以我把它放在 test_helper 中,使其适用于“rake 测试”和 RubyMine:

require 'redgreen' if $stdin.tty?< /code>

导致您问题的可能不是 redgreen,但要怀疑任何可能创建非常规 Test::Unit 输出的内容。

祝你好运!

I posted this answer for another question. It may help with this one as well:

On my system, the problem was the "redgreen" gem. It automatically colors the progress marks (dots) and the Test::Unit summary messages based on success or failure. There must be something in RubyMine that's trying to parse the Test::Unit results (the output of "rake test", I imagine), and it's choking on the ANSI sequences.

I commented out "require 'redgreen'" in my test/test_helper.rb, and the problem went away. I really like redgreen for executing "rake test" from the shell, though, so I put this in test_helper to make it work for both "rake test" and within RubyMine:

require 'redgreen' if $stdin.tty?

It may not be redgreen that's causing your problem, but be suspicious of anything which might create unconventional Test::Unit output.

Good luck!

只想待在家 2024-12-13 05:27:19

我遇到了同样的问题,必须将以下内容添加到 /etc/launchd.conf (我也必须创建此文件):

setenv DYLD_LIBRARY_PATH /usr/local/mysql/lib/

然后重新启动。还有其他方法可以做到这一点(plist 文件,将此环境变量添加到 RubyMine 等......但这是最可靠的。当然,这假设您使用 MySQL。

I had the same issue and had to add the following to /etc/launcd.conf (I had to create this file as well):

setenv DYLD_LIBRARY_PATH /usr/local/mysql/lib/

and reboot. There are other ways to do it as well (a plist file, adding this environmental variable to RubyMine, etc… but this was most reliable. Of course, this assumes that you use MySQL.

提笔书几行 2024-12-13 05:27:19

我的设置最终的答案是摆弄 IDE 设置,包括 ruby​​ 版本,确保它是 1.9.2 以及配置中引用的目录。屏幕是正确的。再加上一些重新启动解决了该问题。

The answer in the end for my setup was to fiddle around with the IDE settings including the ruby version, making sure it was 1.9.2 and the directories referenced in the config. screens were correct. This plus some restarts resolved the issue.

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