Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails 3 RSpec 2 NetBeans integration

NetBeans 6.9 provides a custom Runner class for RSpec to be integrated into the IDE. I'm trying to get my Rails 3 applications specs to be correctly displayed inside NetBeans, but RSpec 2 seems no longer to support custom Runner classes in general.

Any ideas how to get the specs into the IDE anyway?

like image 355
aef Avatar asked Aug 29 '10 01:08

aef


2 Answers

Just in. Oracle has just announced they are withdrawing support for Rails in future version of NetBeans. Time to start looking at other IDE options.

http://news.ycombinator.com/item?id=2148161

like image 122
Evolve Avatar answered Oct 02 '22 00:10

Evolve


So far (NB 6.9.1) the only way I know to run Rspec2 tests from inside NetBeans is by using rake tasks. But I was not able to make it work with UI Test Runner, because of this and few other problems. So the best way is to avoid invoking UI runner, this can be done in many ways:

  • Disable it via tools -> options -> miscellaneous -> Ruby
  • modify project.properties file
  • give other name to task than 'spec', so naming task as 'rspec' will avoid invoking UI runner

This way you will have just test results in output pan, but it is still usable, because you can click anywhere on stack trace, and NB will take you immediately to that file:line.

There is one thing left, auto generated by NB Rakefile has not valid task (for Rails projects, there is NO such problem), to make it work one needs at least:

require 'rspec/core/rake_task'

Rspec::Core::RakeTask.new(:rspec)
like image 22
Ernest Avatar answered Oct 01 '22 22:10

Ernest