-
Notifications
You must be signed in to change notification settings - Fork 550
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 references Rails in non-Rails code #996
Comments
Minitest plugin system looks at all installed gems, so its possible you have a plugin installed that is altering the behavior. Here is what your test looks like in a clean gemset on my system:
|
https://github.com/minitest/minitest?tab=readme-ov-file#writing-extensions-
I don't suppose that behavior is up for re-examination. I will register my personal comment that the result of this design is behavior that I would not expect. Thanks. |
Minitest will automatically scan all installed gems and load plugins from those gems. We should detect whether or not we're being run within the context of a Rails app and only change MT behavior in that case. To determine if we're being run via `bin/rails` we'll just check if RAILS_ENV is set. Ref: minitest/minitest#996 Ref: minitest/minitest#725
Minitest will automatically scan all installed gems and load plugins from those gems. We should detect whether or not we're being run within the context of a Rails app and only change MT behavior in that case. To determine if we're being run via `bin/rails` we'll just check if RAILS_ENV is set. Ref: minitest/minitest#996 Ref: minitest/minitest#725
Minitest will automatically scan all installed gems and load plugins from those gems. We should detect whether or not we're being run within the context of a Rails app and only change MT behavior in that case. To determine if we're being run via `bin/rails` we'll just check if RAILS_ENV is set. Ref: minitest/minitest#996 Ref: minitest/minitest#725
Minitest will automatically scan all installed gems and load plugins from those gems. We should detect whether or not we're being run within the context of a Rails app and only change MT behavior in that case. To determine if we're being run via `bin/rails` we'll just check if RAILS_ENV is set. Ref: minitest/minitest#996 Ref: minitest/minitest#725
Given a file "minitest.rb" that requires minitest/autorun
And minitest 5.22.3 is being used
When I run ruby -Ilib:test ./minitest.rb
I get the output on a failing test:
bin/rails test ./minitest.rb:5
This file does not require any rails, there is no Gemfile, AFAIK nothing that might load any rails thing. bin/rails does not exist at this location. I would expect there be no reference to Rails.
Here's
minitest.rb
Output
In case it might be getting polluted from something automatically trying to require rails, here's a filtered list of what gems are present (but not required in my code):
The text was updated successfully, but these errors were encountered: