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

Non-focused tests still run under rake and bundle exec #1

Closed
joshweinstein opened this issue Feb 28, 2013 · 2 comments
Closed

Non-focused tests still run under rake and bundle exec #1

joshweinstein opened this issue Feb 28, 2013 · 2 comments
Assignees

Comments

@joshweinstein
Copy link

Hi, thanks for your great work Ryan! Eager to use minitest-focus, but haven't been able to get it working in a project using bundle exec. Running minitest-focus' tests locally, I notice that when executing ruby -Ispec test/minitest/test_focus.rb, only the focused tests are run and both pass. However, when executing rake, both focused and non-focused tests run (using rvm, ruby 1.9.3-p327, and minitest 4.6.2).

Am I missing something or is minitest-focus not designed to work when tests are run via rake or bundle exec?

@zenspider zenspider self-assigned this Mar 12, 2015
@zenspider
Copy link
Contributor

Sorry. this slipped through the cracks.

The way that minitest-focus works is by injecting the class using it w/ a method_added hook. That hook manipulates ARGV in such a way that minitest can then process and filter with. The problem is the way that rake's test task works is hostile to ARGV. Add p ARGV at the end of your focused file and you should see the right stuff, but it won't trigger the filter correctly.

If you want a quick experiment, steal make_test_cmd from my hoe gem and use that to create a new task that runs your stuff.

What I really should do is take Rake::TestTask, fix it, and ship it with minitest.

@zenspider
Copy link
Contributor

No response. Closing. Please reopen if you think it should be.

@minitest minitest locked and limited conversation to collaborators Jan 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants