Skip to content

[BUG] undefined method after_run when running Minitest version 4 #114

Open
@JuanVqz

Description

@JuanVqz

Expected Behavior

Be able to use the Minitest deprecation tracker with Ruby 2.3.8 and Rails 3.2.22.5 using the Minitest gem at version 4.7.5

Actual Behavior

If I run the deprecation tracker it breaks with the following error:

vendor/bundle/ruby/2.3.0/gems/next_rails-1.3.0/lib/deprecation_tracker.rb:107:in `track_minitest': undefined method `after_run' for MiniTest:Module (NoMethodError)

Possible Fix

Add a check in the next_rails gem if the app is using Minitest v4, then instead of using after_run it should use the correct method (I think it was after_tests).

To Reproduce

  1. Have a Rails 3.2 with Ruby 2.3 and have Minitest v4.7.3 installed
  2. Configure the deprecation tracker for Minitest
  3. Run the test suite saving the deprecations
  4. see the error

Additional Information

I researched a little bit it seems like the Minitest gem at version 4.7.3 doesn't have the after_run method, it was initially introduced at version 5.0.0

If there are more questions feel free to ping me, 👍

I will abide by the code of conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions