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

Assert that stream is auto-closed in AboutTryWithResources #43

Open
DavidWhitlock opened this issue Jan 25, 2015 · 0 comments
Open

Assert that stream is auto-closed in AboutTryWithResources #43

DavidWhitlock opened this issue Jan 25, 2015 · 0 comments

Comments

@DavidWhitlock
Copy link
Contributor

Based on the discussion in #42, I suggest that we add an assertion that verifies that the close method of the InputStream is invoked in the "try with resources" try block in the AboutTryWithResources. lookMaNoClose() koan.

Unfortunately, there is no isClosed method on InputStream. @matyb suggests that the koan have a helper method that attempts to read from the closed InputStream to verify that it is closed.

See also http://stackoverflow.com/questions/8655901/how-to-check-whether-an-outputstream-is-closed

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

No branches or pull requests

1 participant