18

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?

aef
  • 4,498
  • 7
  • 26
  • 44
  • 1
    All we need is an option to specify where RSpec is located. It shouldn't care about the version. Unless I'm totally blind there is no such option, hence the problem. Come on Netbean's guys - sort it out. I'm back to using Notepad++ instead. – Finglas Nov 23 '10 at 21:03
  • 1
    This is ticket partially making required changes, put you thoughts there nad vote for it https://netbeans.org/bugzilla/show_bug.cgi?id=181844#c7 if you want it faster in the ide. – mpapis Nov 28 '10 at 13:58
  • one of the reasons not to use IDEs like this is because of just this sort of integration issues. – Scott Schulthess Dec 14 '10 at 15:30

5 Answers5

4

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)
Ernest
  • 8,701
  • 5
  • 40
  • 51
4

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

Evolve
  • 8,939
  • 12
  • 51
  • 63
  • Came to post this. Major bummer. The other IDEs are rubbish. I've tried the lot. – Finglas Feb 03 '11 at 18:44
  • 2
    It's back! The JRuby guys have picked up support for NetBeans - see [Ruby on NetBeans lives!](http://blog.enebo.com/2011/02/ruby-on-netbeans-lives.html) for a good explanation – Cincinnati Joe Mar 20 '11 at 21:33
1

I know this is not what you are expecting but you might want to check RubyMine3 out it comes out of the box, you do need to buy a licence but at least you can check it out in the 30 day trial

Mauro Morales
  • 1,517
  • 2
  • 11
  • 12
  • you are talking here about RubyMine!? This is a commercial Ruby IDE. Although it has some advantages I have also found that it has many other problems. I found it to be less stable with some larger tasks. It does have way better integration with Ruby and with Rails though. It does also solve the problem in that way. – yopefonic Jan 20 '11 at 23:49
  • yes RubyMine :P ... so far the only problem I've had is performance, sometimes it just starts eating all of my ram, I just restart it and problem fixed, maybe not the best solution but its something that seems to happen with lots of IDEs – Mauro Morales Jan 23 '11 at 05:34
  • Now that NetBeans is no longer supporting Rails, I indeed bought a copy of RubyMine. It has far better Rails support but I think NetBeans had a better UI and better performance. It seems I will stick to RubyMine as I don't know any better Rails IDE at the moment. – aef Feb 19 '11 at 18:30
  • Rubymine is bad on performance. I have disabled various plugins to improve the speed and also switched to a very basic theme. Also excluding some of the directories(like logs, tmp) in from the Project Structure improves performance. I recently switched to Netbeans for my Rails 2 projects. – Pratik Khadloya Sep 30 '11 at 04:47
  • had the same performance issue after working on a few different projects and the more complexity and code in the project the worst it got. @PratikKhadloya I switched to vim with rails.vim NERDTree and dbext.vim, very recommended if performance is what you are looking for and don't mind the learning curve – Mauro Morales Oct 04 '11 at 05:26
1

I am using RVM.
And at the minimum I wanted to be able to run my Ruby 1.9.2 / Rails 3 / RSpec 2 specs from inside the IDE and be able to click on stack traces for Netbeans to open the right files and lines.

I found a work-around for that:
Put somewhere in the project a ruby file that shells out to run the spec suite. E. g. my ruby file has the following content:

system <<EOF
  time ~/.rvm/wrappers/ruby-1.9.2-p290@default/rspec --drb spec 
EOF

Change the ruby version and gemset as you need it.

The major limitation:
I cannot just run only a single spec. For that I have to change the "spec" parameter to the target spec file (which isn't such a big deal though).

0

Netbeans is fairly sluggish running specs (using rspec1 here), would recommend running specs from command line.

Jim
  • 189
  • 1
  • 14
  • And that is an answer to the question in which way exactly? – jhwist Jan 13 '11 at 12:48
  • The answer is not to waste your time trying to get something to work when it doesn't work very well in the first place. Something quite useful to know I would of thought? – Jim Jan 28 '11 at 10:17