JRuby and $! (Global Exception)

28 12 2006

Loaded suite .

Finished in 0.0 seconds.

0 tests, 0 assertions, 0 failures, 0 errors

I was really starting to hate this message while using JRuby with test/unit. Especially when the tests were just running. So why was this happening to me? Well, here’s how to create the conditions.

require 'rubygems'
require 'test/unit'
require 'blah' #this guy doesn't exist

class TestMe < TestCase
  def test_truth
    assert true

If you run this in JRuby, this guy will fail, but won’t throw the expected exception.

Here’s why.

I only mention this because someone on the JRuby user list was having a problem like this and I think this might have been the cause. I just wanted to make sure that somewhere on the internet, the bug and one of the symptoms were associated.




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 )

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s

%d bloggers like this: