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

MiniTest vs Minitest #963

Closed
gurgeous opened this issue Aug 19, 2023 · 4 comments
Closed

MiniTest vs Minitest #963

gurgeous opened this issue Aug 19, 2023 · 4 comments

Comments

@gurgeous
Copy link

Thanks for all your hard work @zenspider, we love minitest and use it with many projects!

I got bit by this today. It took several hours to track down because my tests were innocently outputting:

0 runs, 0 assertions, 0 failures, 0 errors, 0 skips

I had no idea we were using the wrong module name. Sorry about that. A confounding factor is that we were blindly mixing a few methods into MiniTest::Test, inadvertently creating an empty module... I'm not suggesting we go backward, but maybe we could make this fail more violently for laggards like myself? I can imagine a placeholder MiniTest that blows up instantly if you try to use it. Just a thought.

Even if we don't make any changes, hopefully this issue will help future googlers. Here are some keywords - tests don't run, no tests found, minitest not running tests, minitest not finding tests, tests are being ignored, tests not loading, no minitest runnables, rake test not running tests, etc...

@zenspider
Copy link
Collaborator

I can imagine a placeholder MiniTest that blows up instantly if you try to use it.

How do you envision this?

@gurgeous
Copy link
Author

Maybe?

module MiniTest
  class Test
    def self.inherited(klass)
      # gentle
      warn "`MiniTest` is really ancient and deprecated, use `Minitest` pls"
      # aggressive
      raise "`MiniTest` is really ancient and deprecated, use `Minitest` pls"
    end
  end
end

@AxelTheGerman
Copy link

Thanks for creating this issue - I just upgraded some gems and also had the error NameError: uninitialized constant MiniTest which is because somehow MiniTest::Mock.new used to work but not anymore.

Using the proper Minitest module does the trick - unsurprisingly. Too bad I didn't get the usual Ruby like error messages along the lines of "did you mean 'Minitest'?"

@epugh
Copy link

epugh commented Sep 20, 2023

This got me, I had extend MiniTest::Spec::DSL. Fortunantly this issue pointed me in the right direction!

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

No branches or pull requests

4 participants