-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Abort with argument #2557
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
Abort with argument #2557
Conversation
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.
Thanks!
@@ -28,8 +28,7 @@ | |||
begin | |||
ActiveRecord::Migration.maintain_test_schema! | |||
rescue ActiveRecord::PendingMigrationError => e | |||
puts e.to_s.strip | |||
exit 1 | |||
abort "#{e}".strip |
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.
There is a difference, though. abort
outputs to STDERR, while puts
to STDOUT.
I tend to think that STDERR is more appropriate here.
Cosmetic: I'd prefer to keep e.to_s
. Is there a reason to use string interpolation?
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.
I agree that STDERR seems to be more appropriate. No reason to use string interpolation. I'll go ahead and update the PR. Thank you very much.
It condenses two lines into one being that `abort` exits with 1.
14d37d8
to
5acd27a
Compare
@JonRowe Do you have any objections on merging this small change? |
I'm on the fence due to the change in stdout to stderr |
It'd be the same approach as the one already taken on line 6.
|
Would you wait a bit? We can merge this to the soon-to-be-released RSpec 4. |
Having reviewed this further, I don't mind merging this as is, the intent of the original PR was to produce a better output for this error, and that it was to stdout probably didn't occur. @pirj I leave this decision up to you. |
It condenses two lines into one being that
abort
exits with 1.