How to debug ruby tests in Eclipse/Aptana Studio?

笑着哭i 提交于 2021-02-07 08:52:23

问题


is there a way to debug all/single tests in Aptana Studio / 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.

But how to do that with tests / rspec tests?

Thanks in advance.


回答1:


For a normal ruby file, right click on it and select Debug As > Ruby application.

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)



来源:https://stackoverflow.com/questions/7147067/how-to-debug-ruby-tests-in-eclipse-aptana-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!