Skip to content

Add support for non-existing files to startsWith and endsWith assertions#3853

Merged
scordio merged 3 commits into
assertj:mainfrom
ky0n:3840_abstractPathAssert
Nov 8, 2025
Merged

Add support for non-existing files to startsWith and endsWith assertions#3853
scordio merged 3 commits into
assertj:mainfrom
ky0n:3840_abstractPathAssert

Conversation

@ky0n

@ky0n ky0n commented Jun 13, 2025

Copy link
Copy Markdown
Contributor

Check List:

this is a starting implementation for issue #3840
happy to receive any feedback. thank you!
Implementation for startsWith still open


Co-authored-by: Benjamin König <bekoenig@users.noreply.github.com>

@ky0n ky0n marked this pull request as draft June 13, 2025 11:58
@scordio scordio added the event: Hack.Commit.Push A topic worked on during a Hack.Commit.Push event label Jun 13, 2025
@scordio scordio self-assigned this Jun 13, 2025
@scordio

scordio commented Jun 13, 2025

Copy link
Copy Markdown
Member

@ky0n the two failed jobs are unrelated to your changes, you can ignore them.

@ky0n ky0n force-pushed the 3840_abstractPathAssert branch from a827fd4 to eed6a21 Compare June 13, 2025 21:36
@ky0n ky0n marked this pull request as ready for review June 13, 2025 21:38
@ky0n ky0n force-pushed the 3840_abstractPathAssert branch from eed6a21 to b18021c Compare June 13, 2025 21:42
@ky0n

ky0n commented Jun 13, 2025

Copy link
Copy Markdown
Contributor Author

can you have a look please @scordio, thank you. I tried to be as close as possible to toRealPath-Method with toAbsolutePath().normalize(), while the later will still work without the file existing. I didn't change the toRealPath(Path) method.

…h, startsWith assertions

Co-authored-by: Benjamin König <bekoenig@users.noreply.github.com>
@scordio scordio added this to the 4.0.0-M2 milestone Nov 8, 2025
@scordio scordio merged commit 8ea5a52 into assertj:main Nov 8, 2025
15 of 16 checks passed
@scordio

scordio commented Nov 8, 2025

Copy link
Copy Markdown
Member

This is finally merged! Thanks for your efforts, @bekoenig and @ky0n!

@scordio scordio changed the title feat: dont throw FileNotFound for Path endsWith assertions, add test Add support for non-existing files to startsWith and endsWith assertions Nov 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

event: Hack.Commit.Push A topic worked on during a Hack.Commit.Push event

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Path assertion endsWith throws NoSuchFileException on non-existing file

2 participants