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

Make "rake test" display not only task name but also exception message. #1899

Merged
merged 2 commits into from Jun 29, 2011

Conversation

ihower
Copy link
Contributor

@ihower ihower commented Jun 29, 2011

The "rake test" ignores the exception message. This pull request displays not only task name but also the exception message.

For example:

Errors running test:units, test:functionals!

This pull request:

Errors running test:units! Access denied for user ''@'localhost' to database...
Errors running test:functionals! Command failed with status...

@josevalim
Copy link
Contributor

Tks for the pull request, I like it. Do you think you could add a test to this new format? We already have some here:

https://github.com/rails/rails/blob/master/railties/test/application/rake_test.rb

@ihower
Copy link
Contributor Author

ihower commented Jun 29, 2011

Add test. I can't find good way to test the abort message so I change to puts.

@josevalim
Copy link
Contributor

Thanks. About capturing stderr, wouldn't using capture(:stderr) work? It is defined in this file (that probably should be required as well):

https://github.com/rails/rails/blob/master/activesupport/lib/active_support/core_ext/kernel/reporting.rb

@ihower
Copy link
Contributor Author

ihower commented Jun 29, 2011

It seems the abort method writes to STDERR directly, not $stderr, so it will capture nothing.
STDERR only support reopen to change the os's file descriptor and does not accept StringIO.new :/

josevalim added a commit that referenced this pull request Jun 29, 2011
Make "rake test" display not only task name but also exception message.
@josevalim josevalim merged commit c49d1f2 into rails:master Jun 29, 2011
@josevalim
Copy link
Contributor

Fair enough. merged, thanks!

@ihower ihower deleted the patch_rake_test branch August 16, 2015 03:51
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

Successfully merging this pull request may close these issues.

None yet

2 participants