Rails-perftest not working with Minitest 5.11.3

#43 · closed · 3 comments

View on GitHub ↗

rbclark

There is currently an issue where minitest 5.11.3 will cause this gem to throw a minitest.rb:961:in `run_one_method': TestName#run _must_ return a Result (RuntimeError) This issue is due to a [change in minitest](https://github.com/seattlerb/minitest/blob/master/lib/minitest/test.rb#L109) which causes the `run` method to be expected to return a Result instead of just [`self`](https://github.com/rails/rails-perftest/blob/fc772f40224064cf7ca5256a04607372429021ba/lib/rails/perftest/active_support/testing/performance.rb#L53). The easiest way to fix this is to change the previously linked line in minitest from `self` to `::Minitest::Result.from self` however that will break compatibility with Minitest 4 and < 5.11. Would the preferred way to fix this be to create a new module called `Minitest511AndGreater` which handles this properly and then check the version, or is there a better way that I am missing?

Comments

pioz

When are you going to release the gem with this fix? (I really need it :D)

haggen

Yea a fix for this and the [rubyprof-0.17 bug](https://github.com/rails/rails-perftest/issues/38) would be really great!

aesyondu

Anyone know a workaround for this, since it hasn't been released yet? I have `[email protected]` with error `#run _must_ return a Result (RuntimeError)`