-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Add error message to TemporaryFolder.newFolder("String/String") #959
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
Conversation
@@ -1,18 +1,15 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<projectDescription> | |||
<name>junit</name> |
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.
Please revert the changes to this file:
git checkout master .project
Ditto for the other non-java files
Ops, Sure thing... Thanks for the review ! |
*/ | ||
private void validateIOSeparator(String folderName) throws IOException { | ||
if (folderName.contains(File.separator)) { | ||
throw new IOException(String.format("%s%s%s%n%s", |
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.
It's not very readable to use %s
to format constant strings. I was suggesting that you could use String.format
so you could use File.separator
in the message without concatenating strings.
Thanks for the changes! A few more minor changes. After committing them, could you squash your commits? See https://github.com/junit-team/junit/wiki/Pull-Requests for instructions |
thrown.expect(IOException.class); | ||
thrown.expectMessage(String.format("%s%s%s%n%s", | ||
"It's not possible to use the OS separator to create folder hierarchies like 'MyParentFolder'", | ||
File.separator, "'MyFolder'.", "Please use newFolder('MyParentFolder', 'MyFolder') instead")); |
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.
Also, let's not put a line break in the message. Thanks.
…f temporary folder
Validating for |
If it accepts it. I think we should. Any other special cases? |
One way to see if a path segment is valid is to use it to create a |
Working on improving that; |
Fixed with #974 |
Hey, guys. What happened? |
Please read @kcooney's comment. |
I've read it. I just don't understand what happened... I am kind of new. Thanks! |
Adding error message explaining that you can't create a tempFolder using "Parent/Folder" as one string.