Skip to content

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

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

vbreuss merged 4 commits into
Testably:mainfrom
jeyk:fix/absolutepaths-with-children

Conversation

@jeyk

@jeyk jeyk commented Mar 5, 2026

Copy link
Copy Markdown
Contributor

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

jeyk commented Mar 5, 2026

Copy link
Copy Markdown
Contributor Author

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.

Comment thread Source/Testably.Abstractions.Testing/Initializer/FileSystemInitializer.cs Outdated
@jeyk
jeyk force-pushed the fix/absolutepaths-with-children branch from 22dd078 to e7ed04b Compare March 7, 2026 22:15

@vbreuss vbreuss left a comment

Copy link
Copy Markdown
Member

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

github-actions Bot commented Mar 8, 2026

Copy link
Copy Markdown

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