如何在Eclipse/Aptana Studio中调试ruby测试? [英] How to debug ruby tests in Eclipse/Aptana Studio?

查看:66
本文介绍了如何在Eclipse/Aptana Studio中调试ruby测试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在Aptana Studio/Eclipse中调试所有/单个测试?

is there a way to debug all/single tests in Aptana Studio / Eclipse?

ruby​​-debug19 & ruby​​-debug-ide 已安装,我能够设置断点并调试我的开发环境,例如在控制器的索引方法中.如果我转到 http://localhost:3000/controller_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.

如果您的测试是需要一些设置的测试,或者您想调试整个套件,则需要手动生成调试配置(或手动编辑).运行>调试为>调试配置... ,然后在 Ruby应用程序下添加一个条目.将其指向您的rake脚本路径(例如/usr/local/bin/rake )作为要启动的文件,然后编辑参数以将应用程序的Rakefile作为第一个arg传入,并将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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆