Reputation: 4437
I recently set up Zeus and Minitest for testing a Rails app.
However, I got the following error:
leo% zeus test
/Users/leo/.rvm/gems/ruby-1.9.3-p125@backscratchers/gems/turn-0.9.6/lib/turn/minitest.rb:23:in `<top (required)>': MiniTest v5.0.8 is out of date.
`gem install minitest` and add `gem 'minitest' to you test helper. (RuntimeError)
from /Users/leo/.rvm/gems/ruby-1.9.3-p125@backscratchers/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require'
from /Users/leo/.rvm/gems/ruby-1.9.3-p125@backscratchers/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `block in require'
... etc ...
The line mentioned in the Turn gem is:
# set MiniTest's runner to Turn::MiniRunner instance
if MiniTest::Unit.respond_to?(:runner=)
MiniTest::Unit.runner = Turn::MiniRunner.new
else
raise "MiniTest v#{MiniTest::Unit::VERSION} is out of date.\n" \
"`gem install minitest` and add `gem 'minitest' to you test helper."
#MiniTest::Unit = Turn::MiniRunner
end
So the 'out of date' is a bit misleading perhaps. What it really means is the API is not what’s expected, right?
I removed gem 'turn'
from my Gemfile, run bundle install
, and restart Zeus.
Now I get:
/Users/leo/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/test/unit.rb:328:in `autorun': uninitialized class variable @@installed_at_exit in Test::Unit::Runner (NameError)
from /Users/leo/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/test/unit.rb:640:in `<top (required)>'
from /Users/leo/.rvm/gems/ruby-1.9.3-p125@backscratchers/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require'
from /Users/leo/.rvm/gems/ruby-1.9.3-p125@backscratchers/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `block in require'
from /Users/leo/.rvm/gems/ruby-1.9.3-p125@backscratchers/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:236:in `l
... etc ...
What’s going on here? Do I somehow have the wrong version of Minitest? Why has Bundler not been able to figure out the dependency chain, I thought that was the point.
Any suggestions greatly appreciated.
Upvotes: 0
Views: 987
Reputation: 4437
Well the immediate solution appears to be downgrading Minitest:
gem 'minitest', '~> 4'
However, this then seems to cause knock-on issues when running particular test, as I am now getting uninitialized constant MiniTest::Test
errors when actually running the tests.
Update:
It seems older versions of MiniTest used a different module/class hierarchy, so Minitest::Test
must become MiniTest::Unit::TestCase
.
Note the capitalization of Minitest > MiniTest.
To see what Classes are available to your MiniTest/Minitest, you can use:
MiniTest.constants.select {|c| Class === MiniTest.const_get(c)}
Upvotes: 2