Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installing minitest 5.0.8 breaks stdlib test/unit #358

Closed
apeiros opened this issue Oct 23, 2013 · 5 comments
Closed

Installing minitest 5.0.8 breaks stdlib test/unit #358

apeiros opened this issue Oct 23, 2013 · 5 comments
Assignees

Comments

@apeiros
Copy link

apeiros commented Oct 23, 2013

Try

gem install minitest -v=5.0.8
pry -rtest/unit

If I do that, I get the following exception:

MiniTest::Unit::TestCase is now Minitest::Test. From /path/to/ruby-2.0.0-p247/lib/ruby/2.0.0/test/unit/testcase.rb:8:in `<module:Unit>'
/path/to/ruby-2.0.0-p247/lib/ruby/2.0.0/test/unit.rb:670:in `<class:Runner>': undefined method `_run_suite' for class `Test::Unit::Runner' (NameError)
  from /path/to/ruby-2.0.0-p247/lib/ruby/2.0.0/test/unit.rb:255:in `<module:Unit>'
  from /path/to/ruby-2.0.0-p247/lib/ruby/2.0.0/test/unit.rb:9:in `<module:Test>'
  from /path/to/ruby-2.0.0-p247/lib/ruby/2.0.0/test/unit.rb:8:in `<top (required)>'
  from /path/to/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:53:in `require'
  from /path/to/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:53:in `require'
  from /path/to/ruby-2.0.0-p247/gems/pry-0.9.12.2/lib/pry/pry_class.rb:96:in `block in load_requires'
  from /path/to/ruby-2.0.0-p247/gems/pry-0.9.12.2/lib/pry/pry_class.rb:95:in `each'
  from /path/to/ruby-2.0.0-p247/gems/pry-0.9.12.2/lib/pry/pry_class.rb:95:in `load_requires'
  from /path/to/ruby-2.0.0-p247/gems/pry-0.9.12.2/lib/pry/pry_class.rb:118:in `initial_session_setup'
  from /path/to/ruby-2.0.0-p247/gems/pry-0.9.12.2/lib/pry/pry_class.rb:143:in `start'
  from /path/to/ruby-2.0.0-p247/gems/pry-debugger-0.2.2/lib/pry-debugger/pry_ext.rb:19:in `start_with_pry_debugger'
  from /path/to/ruby-2.0.0-p247/gems/pry-0.9.12.2/lib/pry/cli.rb:201:in `block in <top (required)>'
  from /path/to/ruby-2.0.0-p247/gems/pry-0.9.12.2/lib/pry/cli.rb:70:in `call'
  from /path/to/ruby-2.0.0-p247/gems/pry-0.9.12.2/lib/pry/cli.rb:70:in `block in parse_options'
  from /path/to/ruby-2.0.0-p247/gems/pry-0.9.12.2/lib/pry/cli.rb:70:in `each'
  from /path/to/ruby-2.0.0-p247/gems/pry-0.9.12.2/lib/pry/cli.rb:70:in `parse_options'
  from /path/to/ruby-2.0.0-p247/gems/pry-0.9.12.2/bin/pry:16:in `<top (required)>'
  from /path/to/ruby-2.0.0-p247/bin/pry:19:in `load'
  from /path/to/ruby-2.0.0-p247/bin/pry:19:in `<main>'
@zenspider
Copy link
Collaborator

Yes. That will happen. test/unit is compatible with minitest 4 and does not gem activate before it requires. It assumes, naively, that there are no gems. minitest 5 and test/unit are not meant to be used together.

@ghost ghost assigned zenspider Oct 24, 2013
@apeiros
Copy link
Author

apeiros commented Oct 25, 2013

That's the point - I do NOT use them together. Minitest 5 is only installed. That alone is sufficient to break test/unit. (I do not even use minitest at all - that it is installed is because something else I installed comes with minitest 5 as a dependency)

@zenspider
Copy link
Collaborator

Yes, that alone is enough to break test/unit. You're using them together. test/unit uses minitest. If the gem is installed, it uses the latest version. I suggest you don't have minitest 5 installed globally if you use test/unit (tho, I can also suggest: don't use test/unit, use minitest and this problem goes away quickly). You can use bundler and similar solutions to install minitest into private repos instead.

If you installed something w/o specifying --development and it installed minitest, then that gem most likely has a bug in their dependency specification. minitest is a development dependency 99+% of the time. If you're not using minitest, and something else is bringing it in, then something is most likely wrong in the gem dependency tree. What gem was it?

@chrisk
Copy link

chrisk commented Nov 24, 2013

If you installed something w/o specifying --development and it installed minitest, then that gem most likely has a bug in their dependency specification. minitest is a development dependency 99+% of the time. If you're not using minitest, and something else is bringing it in, then something is most likely wrong in the gem dependency tree. What gem was it?

FYI for anyone else with the same problem: I started seeing the same exception tonight with a gem that does legitimately specify minitest as a runtime dependency—Rubinius's test/unit gem. (Rubinius 2 distributes the stdlib as gems, e.g. rubysl-test-unit.) For some reason, rubysl-test-unit relaxed its minitest requirement in its recent 2.0.2 release... it was previously "~> 4.7" in 2.0.1's gemspec, but 2.0.2 allows any version. I just posted a comment over there: https://github.com/rubysl/rubysl-test-unit/commit/1b40e28c380c64d36cafc107255f01daa249a83a.

@zenspider thanks for explaining, very helpful.

@zenspider
Copy link
Collaborator

This is an issue with test/unit (and possibly other gems with bad dependencies), not minitest. Closing.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants