如何在 Eclipse/Aptana Studio 中调试 ruby 测试? [英] How to debug ruby tests in Eclipse/Aptana Studio?
问题描述
有没有办法在 Aptana Studio/Eclipse 中调试所有/单个测试?
is there a way to debug all/single tests in Aptana Studio / Eclipse?
ruby-debug19
&ruby-debug-ide
已安装,我可以设置断点并调试我的开发环境,例如在控制器的索引方法中.如果我去 http://localhost:3000/controler_name
eclipse 打开调试透视图并停止.
ruby-debug19
& ruby-debug-ide
are installed and I'm able to set breakpoints and debug my development environment, e.g. in a controller's index method. If I go to http://localhost:3000/controler_name
eclipse opens debugging perspective and halts.
但是如何通过测试/rspec 测试来做到这一点?
But how to do that with tests / rspec tests?
提前致谢.
推荐答案
对于普通的 ruby 文件,右键单击它并选择 Debug As > Ruby application.
For a normal ruby file, right click on it and select Debug As > Ruby application.
如果您的测试是需要一些设置的 rails 测试,或者您想调试整个套件,则需要手动生成调试配置(或手动编辑).运行 > 调试方式 > 调试配置... 然后在 Ruby 应用程序 下添加一个条目.将它指向您的 rake 脚本路径(例如 /usr/local/bin/rake
)作为要启动的文件,然后编辑参数以将您的应用程序的 Rakefile 作为第一个参数传递,并将 rake 任务作为第二个参数.(即 /my/path/to/project/Rakefile 测试
)
If your test is a rails one that requires some setup, or you want to debug the whole suite, you'll need to generate a debug configuration manually (or edit one manually).
Run > Debug As > Debug configurations... Then add an entry under Ruby application. Point it at your rake script path (say /usr/local/bin/rake
) as the file to launch and then edit the arguments to pass in your app's Rakefile as the first arg and the rake task as the second arg. (i.e. /my/path/to/project/Rakefile tests
)
这篇关于如何在 Eclipse/Aptana Studio 中调试 ruby 测试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!