JRuby 1.3.0 with AutoTest
I had some trouble getting JRuby 1.3.0 and ZenTest 4.1.3 autotest to work together. Part of the problem is that the subprocess that launches autotest ignores any attempt to turn ObjectSpace on. The other part of the problem is how jruby parses -u after the unit_diff command. Here’s a way to hack in fixes for each problem:
Open zentest.rb in the ZenTest gem lib directory and add the following to the top.
if RUBY_PLATFORM == 'java' require 'jruby' JRuby.objectspace = true end
Open autotest.rb and in the initialize of the Autotest class change
self.unit_diff = "unit_diff -u"
to
if RUBY_PLATFORM == 'java' self.unit_diff = "unit_diff" else self.unit_diff = "unit_diff -u" end
Run autotest.
Any chance of getting this patched into ZenTest?
G
gareth
December 18, 2009 at 12:16 pm
Thanks for your post. Applied both of your suggested patches, but autotest finds no tests:
/jruby -I.:lib:test -rubygems -e “%w[test/unit test/test_helper.rb].each { |f| require f }” | unit_diff
Loaded suite -e
Started
Finished in 0.002 seconds.
0 tests, 0 assertions, 0 failures, 0 errors
Ideas of what could be causing this?
iamtheschmitzer
February 16, 2010 at 5:26 pm
If autotest finds no test just install:
gem autotest-rails
Hope I could help.
crimi
July 21, 2010 at 4:48 am