Luasjian
Luasjian

Reputation: 96

How to debug ruby tests in Eclipse/Aptana Studio?

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.

Upvotes: 3

Views: 3519

Answers (1)

Christopher Williams
Christopher Williams

Reputation: 2907

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)

Upvotes: 4

Related Questions