-
-
Notifications
You must be signed in to change notification settings - Fork 210
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
add Path.hasDirectoryEntry as shortcut for Path.isDirectory + Path.resolve + Path.exists #590
Comments
Hello, can I work on this ? |
Sure |
Hello, I'll work on this... |
I think you can if @robstoll is ok. I couldn't manage to take the time to work on this. |
@ezesalas7 go ahead and let me know if you need help. |
Thanks @robstoll, I am setting up the project now. First time contributing to open source, pretty exited! Hope I can get It done :) |
I'll work on this |
@jgrgt there is already someone working on this. Please take another issue unless @ezesalas7 does not have time |
@jgrgt sorry, I have not seen that @ezesalas7 unassigned himself. So go ahead 👍 |
@jgrgt unassigning so that others can take over. Let us know in case you still work on it (or if you need help) |
@robstoll Sorry about the lack of updates, I got stuck. Naming the function
|
No problem, re-assigned you. Please push everything you have, always easier to review and help. |
@robstoll I pushed my code to a branch on my clone. Here's a diff https://github.com/robstoll/atrium/compare/master...jgrgt:path-contains?expand=1 Not sure if I'm allowed to create a 'WIP' pull request for this or not. |
You can always create a WIP pull request, no problem. Please do so, easier to keep track of changes for me. |
I know I am late to the party, but I have an objection against this method being called “ expect(Path.of("/foo/bar")).contains(Path.of("bar")) // will succeed
expect(Path.of("/foo/bar")).contains("bar") // will or will not succeed, depending on the content of the /foo/bar directory I think it is bad that we have Since it is not released yet, now would be the time to rename the method. Do you agree that we should? I’d suggest something like |
@jGleitz good you spotted this. I forgot that Path implements Iterable. Would you like to do the fix? |
I am glad to raise a PR. Is |
@jGleitz I think name is OK and better than |
How is this assertion supposed to behave for symbolic link entries? I would expect that the assertion resolves a symbolic link if the subject is a symbolic link, but does not follow symbolic links for the directory entries. However, the current implementation also resolves symbolic links for the file system entries. For example, this assertion: expect(Path.of("/foo/bar")).hasDirectoryEntry("baz") would fail with the current implementation if What do you think? |
nice catch, I agree, I would intuitively also expect it to hold if the link is there regardless where it points to. |
Platform (all, jvm, js, android): all
Extension (none, kotlin 1.3): none
Code related feature
Following the things you need to do:
api-fluent
contains
which expectspath: String, vararg otherPaths: String
and returnsExpect<T>
(see resolve with expect an assertionCreator in pathAssertions.kt as a guideline)@since 0.14.0
(adapt to current milestone) to KDOCcontains
to PathAssertionsSpec in specs-common and extend it in atrium-api-fluent-en_GB-common/src/testYour first contribution?
I'll work on this
if you would like to take this issue over.This way we get the chance to revise the description in case things have changed in the meantime, we might give you additional hints and we can assign the task to you, so that others do not start as well.
(Invite yourself in case you do not have an account yet).
The text was updated successfully, but these errors were encountered: