minitest / minitest-focus

72 stars 9 forks source link

Command-line switches have less priority then config #19

Closed senhalil closed 1 year ago

senhalil commented 2 years ago

While "focusing" on some tests, I sometimes need to launch a specific test momentarily. However, since minitest-focus takes precedence ("Ignoring -n / --name, using focus filters instead"), one solution is commenting out all focuses but this is clunky and manual. Or adding focus to this new test as well but then I have to launch all the other tests too.

My expectation was the command-line interface flags would have the highest priority since these are supplied the last by the user and they can be easily modified (compared to modifying the code).

I suggest "Ignoring focus filters, using -n / --name instead" this way the user has the choice to launch a specific test momentarily using the --name flag while keeping all focuses intact and they can come back to the previous setup by removing the name flag.

zenspider commented 2 years ago

I don't have this problem (I basically never use focus)... so a PR would be most welcome.

zenspider commented 1 year ago

Done. Thanks!

senhalil commented 1 year ago

Thanks @zenspider! Sorry for not responding your previous message, it must have fallen thru the cracks.

To close the loop, it is this commit which adds the --no-focus option that can be used to ignore all focuses implements the above behaviour.