-
Notifications
You must be signed in to change notification settings - Fork 88
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
Rails 5 issues: invalid option: --guard #142
Comments
@tmichel - any ideas for problem 1? |
For problem 2: This probably doesn't help much, it could give ideas: #133 Can you create a mini project to recreate the problem? (I don't have time right now, but if I had a small repo with this issue, I could check exactly what is going on). |
Maybe also related: #130 |
For problem 1 the cause is definitely the linked Rails issue (rails/rails#25046). Rails has its own minitest runner and that parses options ahead of time and minitest plugins could not register their own flags. This probably breaks any other plugin that uses custom command line flags. Using a flag to signal the plugin is pretty much the recommended minitest way. I don't know if the mentioned Rails bug should be "supported" by guard-minitest and worked around somehow. |
…arily because of issues. guard/guard-minitest#142
Guys? Seems that 6 months after this issue was open seems that even on the most recent version of the gems ( |
For me the following setup works flawlessly:
# in Guardfile
guard :minitest, spring: "bin/rails test", all_on_start: false do
# usual rules for Rails apps
end |
Hey @tmichel will check it out! |
@tmichel thanks! Worked for me |
Worked for me too, thanks @tmichel :-) |
Any better solution exist? |
Paring down @tmichel's solution, I managed to get away with just: guard :minitest, spring: 'rails test' do
# rules
end |
This is occurring for me too. There's nothing remarkable about my app. I'm not even using Spring. I'm using the default Guardfile generated with
Rails tests work fine by themselves.
Rails 5.0.2, Windows |
I get this error without Rails, in just a plain Ruby gem, that I created with the |
I also get this error and I'm not using Rails. |
Upgraded to Rails 5 and guard-minitest
v2.4.6
today. Got two issues:Problem 1
bundle exec guard
withguard :minitest do
i get the following error:it might be related to the following issue: rails/rails#25046 and #141
if i add spring to the guardfile
guard :minitest, spring: true do
theninvalid option: --guard
doesn't appear and all tests run . Also rolling back tov2.4.5
solves the issue.Problem 2withsee #130spring: true
i cannot get specific test to run. Havingwatch(%r{^test/.+_test\.rb$})
in guardfile and updating for exampleuser_test.rb
it runs all tests. Without spring it runs onlyuser_test.rb
The text was updated successfully, but these errors were encountered: