This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
I have installed rspec, rspec-rails and ZenTest as gems. Versions of these gems are as follows: rspec (1.1.11) rspec-rails (1.1.11) ZenTest (3.11.0) Version of Ruby interpreter is 1.8.6 (2008-08-08 patchlevel 286). I'm unable to start AutoTest from within NetBeans IDE. This is what i've got: /home/piter/netbeans-6.5/ruby2/nb_autotest_loader.rb:68: warning: method redefined; discarding old hook /home/piter/netbeans-6.5/ruby2/nb_autotest_loader.rb:65:in `make_test_cmd': undefined local variable or method `spec_command' for #<Autotest::RailsRspec:0x9569f9c> (NameError) from /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/ZenTest-3.11.0/lib/autotest.rb:246:in `run_tests' from /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/ZenTest-3.11.0/lib/autotest.rb:231:in `get_to_green' from /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/ZenTest-3.11.0/lib/autotest.rb:211:in `run' from /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/ZenTest-3.11.0/lib/autotest.rb:209:in `loop' from /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/ZenTest-3.11.0/lib/autotest.rb:209:in `run' from /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/ZenTest-3.11.0/lib/autotest.rb:139:in `run' from /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/ZenTest-3.11.0/bin/autotest:55 from /opt/ruby-enterprise/bin/autotest:20:in `load' from /opt/ruby-enterprise/bin/autotest:20 Finished in 0.0 seconds. 0 tests, 0 failures, 0 errors Running command autotest from shell in my Rails project root works fine without any problems. The one thing I had to do was adding ENV['RSPEC'] = 'true' to my atotest binary because without that ENV variable autotest doesn't works with RSpec tests. I tested this configuration on two machines with Linux and Mac OS X and on both I've got the same error.
Thanks for the report. Seems like a method we were relying got removed in RSpec 1.1.11. Currently there is no stable API to code against, so this happens from time to time. I'll try to fix this for M1 and attach a patch here for 6.5.
Should be fixed now, changeset http://hg.netbeans.org/main/rev/a76eadcb99ec. If you don't want to use a dev build, you can patch your 6.5 by downloading the two files from the above link and copying them to the /home/piter/netbeans-6.5/ ruby2/ directory. No need to restart the IDE. Let us know if that doesn't solve the issue for you. On a related note, the IDE should probably run the autospec binary instead of autotest for RSpec tests. I'll handle that in a separate issue.
Integrated into 'main-golden', will be available in build *200812050201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/a76eadcb99ec User: Erno Mononen <emononen@netbeans.org> Log: #154313: Unable to run autotest with RSpec framework
I patched NB with those files and everything works properly now. Thank you.
Hmmm not all things went ok. Autotests starts properly but if there is some error in my code it seems to looping failed test again and again. The same autotest which is fired from plain console works properly. Another thing is even more weirder. For example - i have error in my AR model, autotest from NB is in that loop, when i comment out bad part of code test will pass ok, when i uncomment it autotest does not recognize any changes in this file - only some changes directly in corresponding test file influences autotest to run again and report an error. As I said - the same autotest from console works as I excpect - any changes in both my AR model and its test fire autotest to run again but only once. Sorry for my english - I hope it could be understand.
Too bad -- I'm reopening this for further investigation.
Bumping up the priority.
Just an update on this: I'm working on this now, I have a fix for the IDE's test loader that seems to fix the problem with rspec test, just that it makes the loader incompatible with test/unit.. so I still need to figure out how to make both work.
ZenTest gem provides two separate scripts for running tests: autotest and autospec. Maybe two options in context menu would be better? One for "Autotest test/unit" and another for "Autotest rspec".
Yes, in fact I have already implemented separate context menu items for autospec and autotest. I still need to do some testing before I can commit this stuff. The autospec executable doesn't work with JRuby though, but that has to be fixed in autospec itself.
Integrated into 'main-golden', will be available in build *200902220201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/d353f475a600 User: Erno Mononen <emononen@netbeans.org> Log: #154313: Unable to run autotest with RSpec framework
So this should in the dev builds for some time now, can you give it a try and let us know whether it works for you now? Thanks.
You mean latest nightly build from http://bits.netbeans.org/download/trunk/nightly/latest/ or 6.7M2 from http://bits.netbeans.org/download/6.7/m2/ ?
I think the fix is in M2 already, but I'm really not sure now - so please try with the latest nightly to be sure.
Note: there is now an action named AutoSpec in the project context menu, please use that one instead of AutoTest.
Marking as incomplete for now, please let us know when you've had a chance to test this.