问题
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