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

Support new Rails 5 syntax #34

Open
leppert opened this issue Aug 11, 2016 · 6 comments
Open

Support new Rails 5 syntax #34

leppert opened this issue Aug 11, 2016 · 6 comments

Comments

@leppert
Copy link
Contributor

leppert commented Aug 11, 2016

Beginning with Rails 5.0.0, testing is expected to be run via the rails test command rather than rake test, with rake test being fully deprecated at some point in the future. The effect of this today is that paths and test names passed via rake appear to be ignored, instead running the entire suite.

Not sure if the best solution here is to add a new (defcustom use-rails-5-syntax) or try to infer the appropriate syntax based on the project.

More on the new syntax can be found here. One upside is that the new runner accepts line numbers for running individual tests, which should obviate the need to regex for the test name.

@arthurnn
Copy link
Owner

would be awesome to infer it from the project, not sure how we would be able to do that tho

@leppert
Copy link
Contributor Author

leppert commented Aug 11, 2016

rails -v gives you the version, which you could then test against. And rails -h gives you all the commands to which rails responds, which could be used to see if "test" is one of the supported commands.

The main concern I have with both of these is that they're slow—too slow to run before each test run. But they might be fine for setting some sort of project level config, something like minitest-infer-and-write-config that then sets defs in .dir-locals.el. Awkward, and would need to be rerun if you upgrade or downgrade Rails, but maybe not so bad? Wonder if there are any other Emacs libs that do something similar.

@arthurnn
Copy link
Owner

@leppert interesting. we need to keep in mind this should also work outside rails, for ruby only projects.
But I guess what you said make sense 👍

@arronmabrey
Copy link

Just bumped into this as well using minitest-emacs in spacemacs. Following along. :-)

@Linuus
Copy link

Linuus commented Feb 12, 2020

Setting minitest-use-rails to t will use the rails test ... command.

@gcentauri
Copy link
Collaborator

Setting minitest-use-rails to t will use the rails test ... command.

Indeed. This config is newer than this issue, and solves the original problem. I still think it could be nice to auto-detect a rails project and version to see if rake or bin/rails is preferred.

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

No branches or pull requests

5 participants