-
Notifications
You must be signed in to change notification settings - Fork 3
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
Fix Properties.store(OutputStream os, String comment)
#24
Conversation
Ok, first, good catch, the docs of
(closing the writer doesn't close the stream, right? I never know and the docs are not clear) Second... introducing a new way of testing? Awesome... are you going to migrate the rest of the tests as well? 😁 😛 |
Actually closing the writer flushes and then closes the stream. Maybe we should only flush it instead of closing in a try-with-resources block, I'll check.
I was thinking of leaving the other tests as an exercise for the reader 😉 |
Hahaha, ok, can I then ask a favor? Could you split the PR in two, one for this fix with a test that follows the same pattern as the other tests and then a new PR showing a single test converted to using that approvals library? I'll then use that PR as a basis for migrating all file-based tests to that system in the future. |
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.
Split into two PRs
This fixes the store method taking an `OutputStream` by flushing and closing the writer created to wrap it.
Created #26 (I'll rebase once this PR is merged) |
Thanks man! :-) |
This fixes the store method taking an
OutputStream
by flushing and closing the writer created to wrap it.It also introduces ApprovalTests (https://approvaltests.com/) to open a diff window when comparing Strings and File contentsProperties#store(OutputStream)
doesn't flush the output to theOutputStream
#23