Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

TemporaryFolder.newFile should fail if file already exists #413

Closed
simplyarjen opened this Issue Apr 4, 2012 · 1 comment

Comments

Projects
None yet
2 participants
Contributor

simplyarjen commented Apr 4, 2012

If I am mistakenly call TemporaryFolder.newFile twice with the same filename (in a single test), I expect the second invocation to throw an exception, as a file by that name already exists (so no "new fresh file" as the javadoc so aptly puts it can be created). Instead (in junit 4.10), it succeeds and simply returns a File object pointing to the existing file.

Owner

dsaff commented Apr 9, 2012

Good catch. Thanks!

It may be a while before we can get to this. If you'd like to try your hand at a patch, it would be greatly appreciated!

@dsaff dsaff closed this in 5baa714 Apr 10, 2012

@dsaff dsaff added a commit to marcphilipp/junit that referenced this issue Apr 12, 2012

@dsaff dsaff Merge pull request #419 from simplyarjen/master
Make TemporaryFolder.createFile fail if the file already exists (Fixes #413)
3624da3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment