syntatic

JRuby 1.3.0 with AutoTest

with 3 comments

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.

About these ads

Written by syntatic

August 13, 2009 at 11:24 am

Posted in Uncategorized

3 Responses

Subscribe to comments with RSS.

  1. Any chance of getting this patched into ZenTest?

    G

    gareth

    December 18, 2009 at 12:16 pm

  2. 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

  3. If autotest finds no test just install:

    gem autotest-rails

    Hope I could help. :-)

    crimi

    July 21, 2010 at 4:48 am


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: