Rspec Controller Generator

Yes, that is the issue.

The Netbeans IDE 6.5 interface which I use to generate Rspec controllers
uses a gem called rspec_generator which is outdated and uses the old
format (which makes sense considering the version numbers match the
"old" version numbers). I'll try to find a newer version of that gem
somewhere that matches 1.2.6 so that the IDE works properly again.

Many thanks!

Okay I figured it out - thanks to your direction!

I uninstalled rspec_generator gem (very outdated)

I copied rspec and rspec-rails to the vendor/plugins directory and now
netbeans IDE sees the correct generators.

If anyone else has this same issue - that's the fix.

J. D. wrote:

Yes, that is the issue.

The Netbeans IDE 6.5 interface which I use to generate Rspec controllers
uses a gem called rspec_generator which is outdated and uses the old
format (which makes sense considering the version numbers match the
"old" version numbers). I'll try to find a newer version of that gem
somewhere that matches 1.2.6

I doubt that you will have much luck with that. As I said, I've never
heard of it despite using RSpec regularly, so I assume its place has
been taken by rspec-rails.

so that the IDE works properly again.

Many thanks!

If NetBeans is expecting the rspec_generator gem, perhaps you should
upgrade its Rails tools...or switch IDEs...or just do without an IDE as
such. Unlike, say, J2EE, Rails doesn't really need most of the stuff
that IDEs are good at (although I plan to try NetBeans myself sometime),
and if NetBeans is expecting a particular setup that's no longer
accurate, then it's actually hurting your productivity, not helping it.

Best,

FWIW, I would recommend using the gems instead of the plugins. You can put the configs in your config/environments/test.rb as such:

config.gem 'rspec', :version => ">=1.2.6" , :lib => false
config.gem 'rspec-rails', :version => '>=1.2.6', :lib => false
config.gem 'webrat', :version => '>=0.4.4', :lib => false
config.gem 'faker', :version => '>=0.3.1', :lib => 'faker'
config.gem 'notahat-machinist', :version => '>=0.3.1', :lib => 'machinist', :source =>'http://gems.github.com'

The nice thing about gems is that you can include them on a per-environment basis. Plugins load by default in all environments.

I also use webrat, faker, and machinist ... you may want to check these out.

Once you've updated your config file, just:

rake gems RAILS_ENV=test

and you will see that some of the gems are not installed. To install them, either do it manually, or let Rails help out:

rake gems:install RAILS_ENV=test

Finally, when you want to generate a controller and spec, just:

ruby script/generate rspec_controller some_controller_name

and when you want a model and spec:

ruby script/generate rspec_model some_model_name

These aren't scaffolding generators; they just create the empty spec files and they don't clutter up your test directory with tests you won't use because you're writing specs instead.