-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
remove unnessary option setting from test runner #24696
Conversation
r? @kaspth (@rails-bot has picked a reviewer for you, use r? to override) |
|
||
assert_match '1 runs, 1 assertions', output | ||
assert_match 'Execute test', output | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add test from #24372 to accompany this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean add a test using --rakefile
option?
If so, I've added a test.
Nice fix. This does work for me now:
But
doesn't. We can probably check and include a fix for that here. |
dacb714
to
1c52de9
Compare
Thank you for pointing it out! Also fixed |
@@ -19,6 +19,9 @@ task routes: :environment do | |||
|
|||
OptionParser.new do |opts| | |||
opts.banner = "Usage: rails routes [options]" | |||
|
|||
Rake.application.standard_rake_options.each { |args| opts.on(*args) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is iffy. We'd likely need to swallow rake options for every Rails command with custom option parsing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, come to think of it there might not be other cases since routes and test are the only rake tasks we fiddled with in Rails 5. So this feels like an ok compromise 👍
If run the test over the `rake` command, because of the test patterns is passed via `rake_run` method, do not need to be obtained from the argv. This probably fixes rails#24372.
In order to prevent `OptionParser::ParseError` when specify the rake options to `routes` task.
1c52de9
to
996092e
Compare
❤️ |
😄 |
If run the test over the
rake
command, because of the test patterns is passedvia
rake_run
method, do not need to be obtained from the argv.This probably fixes #24372.