On Tue, Jun 10, 2014 at 9:24 PM, Julian C. Dunn <jdunn(a)aquezada.com> wrote:
What's the accepted wisdom to fixing these? Disable tests on
Convince upstream to upgrade? Both? Other suggestions?
There are a couple of approaches here.
The first step is to remove the "testrb" command and swap it for a
simple ruby command. For example, see
. For capillary, that was enough to fix the build, because the test
suite only used Minitest::Spec and didn't use Minitest::Unit at all.
If your gem uses Minitest::Unit then it can be a bit harder, and
you'll need to port it to Minitest 5's syntax. Here's the four most
common things I've run into when porting gems' test suites:
1) Rename all uses of "MiniTest::Unit::TestCase" to "Minitest::Test"
2) Change "require 'minitest/unit'" (or 'test/unit') to
3) "assert_raise" functions should be renamed to "assert_raises"
4) "assert_not_foo" should be renamed to "refute_foo". For example,
the "assert_not_nil" function is gone in Minitest 5. It should be
replaced with "refute_nil".
I've found that upstreams have been fairly receptive to patches that
port to Minitest 5. So far svn2git, asciidoctor, resque-cleaner,
geoip, literati and charlock_holmes have all accepted the pull
requests for Minitest 5 support, and there are a couple of upstreams
that are still reviewing the patches.
Even if you can't port the test suite yourself, it is still a good
idea to raise the issue with upstream.
If you can't get the test suite to work, mtasaka has packaged
minitest4 and it's available in Rawhide as a stop-gap until we can get
everything ported over.
The last resort would be to disable the test suite during %check, but
that's a last resort :) Even if you have to do this, at a minimum, it
would be a good idea to put "BuildRequires: rubygem(minitest4)" so
that we can all track this progress centrally using repoquery.