JRuby 1.1.2 is going to be released (probably) today and it fixes a bug with
$~ constants (
Regexp.last_match), which made autotest finally work!
jruby -S gem install ZenTest cd myproject jruby -S autotest
I’ve previously submitted a patch to ZenTest guys. It makes the use of autotest possible with any JRuby 1.x, but now, with JRuby 1.1.2, autotest should just work out of the box!
11 thoughts on “JRuby and autotest (ZenTest)”
I installed JRuby 1.1.2 and ZenTest using the commands you suggested but the jruby -S autotest line seems to do nothing for me. The process just hangs there but there is no visible result.
jruby -S autotest
jruby -S autotest file.rb > test_file.rb
Nothing ever happens. Maybe you have some suggestions that could help me out.
Exactly the same problem here.
I’ve just tested it here and it is working.
What do you have in your ~/.autotest file? You can see mine here: http://pastie.org/237794. This .autotest file notifies autotest results through Growl. It should work in Mac OS X Leopard (as long as you have the required applescript* and images).
I would also suggest you to take a look in your spec/spec.opts file.
* required applescript: http://pastie.org/237795
I have nothing like an .autotest file. And I have no idea about what Growl might be. To be honest I don’t really know how autotest should work. Shouldn’t we go first through ZenTest to automatically generate the unit test cases? Then working on the “stuffing” and finally running autotest? If this more or less describes the steps that should be taken then I’m not even managing to use ZenTest properly. I can’t get it to autogenerate the test cases.
I see others with similar complaints to my own. But I can’t find any forums around the zentest site. If you could point me to the proper place to ask my question, I’d be grateful.
I’m a novice with ruby and even moreso with jruby. Trying to run zentest to generate test code for a class, I get:
$ jruby -S zentest
/opt/jruby-1.1.3/lib/ruby/gems/1.8/gems/ZenTest-3.10.0/lib/zentest.rb:5:in `each_object’: ObjectSpace is disabled; each_object will only work with Class, pass +O to enable (RuntimeError)
from /opt/jruby-1.1.3/lib/ruby/gems/1.8/gems/ZenTest-3.10.0/lib/zentest.rb:27:in `require’
from /opt/jruby-1.1.3/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require’
from /opt/jruby-1.1.3/lib/ruby/gems/1.8/gems/ZenTest-3.10.0/bin/zentest:19:in `load’
(I’m running on Linux if it matters.) I may be doing something very simple and basic wrong, but google hasn’t helped me out in this regard. Would you have any suggestions?
Check this link: http://markmail.org/message/ovanebd622f54crv#query:%22each_object%20will%20only%20work%20with%20Class%22+page:1+mid:ua5dtsqogcpspmma+state:results.
I think they may have an answer on the 23 Jul 2008 05:56 post.
Not sure, though.
Have you had any luck using jruby 1.1.6 and autotest?
I’ve installed the latest gem for ZenTest and then went to my project directory and typed ‘autotest’ and I always get the same error:
“/opt/jruby-1.1.6/lib/ruby/gems/1.8/gems/ZenTest-3.11.1/lib/zentest.rb:5:in `each_object’: ObjectSpace is disabled; each_object will only work with Class, pass +O to enable (RuntimeError)”
I’ve tried using the +O option and I still get the same error.
Maybe I’m not calling autotest properly?
I’d really appreciate anyone has any ideas.
jruby -J-Djruby.objectspace.enabled=true -S autotest
I get the same error as Litenin, even with -J-Djruby.objectspace.enabled=true
Hi JRuby Gurus,
I get the above error trying it with jruby 1.2.0 and 1.3.0.
Did somebody found a solution (it’s summer now 😉
It’s `jruby -X+O autotest`, I believe. We ran into the same ObjectSpace problem at work, and googled a resolution.