Skip to content

fix: Correctly handle absolute and multi-component directory paths#954

Merged
vbreuss merged 4 commits intoTestably:mainfrom
jeyk:fix/absolutepaths-with-children
Mar 8, 2026
Merged

fix: Correctly handle absolute and multi-component directory paths#954
vbreuss merged 4 commits intoTestably:mainfrom
jeyk:fix/absolutepaths-with-children

Conversation

@jeyk
Copy link
Copy Markdown
Contributor

@jeyk jeyk commented Mar 5, 2026

When initializing a directory's children, pass the complete Name of the directory instead of a DirectoryInfo object. This ensures that if a directory is initialized with a multi-component name such as C:\temp\mysubdir, its children are created at the correct depth.

@jeyk
Copy link
Copy Markdown
Contributor Author

jeyk commented Mar 5, 2026

While this fixes #941 without breaking any other functionality, I'm not quite happy with it. I had to introduce a constructor that's only used for this specific purpose.

I would like to fully replace the other constructor that takes a DirectoryInfo, but I could not find a way to do so without large-scale changes to interfaces. If you have any suggestions on how to achieve that, I'll be happy to hear them.

@jeyk jeyk force-pushed the fix/absolutepaths-with-children branch from 22dd078 to e7ed04b Compare March 7, 2026 22:15
Copy link
Copy Markdown
Member

@vbreuss vbreuss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @jeyk, looks good to me.
I will merge and release shortly...

@vbreuss vbreuss merged commit 08ef4a4 into Testably:main Mar 8, 2026
11 checks passed
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 8, 2026

This is addressed in release v5.3.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MockFileSystem initialization handles absolute paths in an unexpected way

2 participants