I have a project with self written gems in jruby (using rvm to switch between jrubies). With jruby-1.7.0 I could do my tests with Test::Unit::TestCase. Now I have switched to MiniTest in jruby-1.7.13. But I cannot run my tests any more with 'rake test'.
The errors are like ... Mocha::ExpectationError: unexpected invocation: blabla.new() ... with blabla beeing my jruby class
It only works if I run them solely via the TEST= and TESTOPTS= parameter to use a single test file and select one or a view tests via --name= (with regular expressions).
I use a helper file with
require 'minitest/spec'
require 'minitest/autorun'
require 'mocha/integration'
class MiniTest::Test
end
instead of the lines used for the old test suite Test::Unit::TestCase
require 'test/unit'
require 'shoulda'
require 'mocha'
class Test::Unit::TestCase
end
A major difference in MiniTest is the test order. So I tried to circumvent the randomization by definig the test_order like
class MiniTest::Test
def test_order
:alpha
end
end
this had no effect on the test order, but Is this realy a problem? The errors seem to come with too may tests in the test suite. Is this a bug? Please help!
You may also check require self made gem in jruby fails after update to jruby-1.7.13 for my preious post where I already could solve a load problem.