TestableIO / System.IO.Abstractions.Extensions

Convenience functionality on top of System.IO.Abstractions
MIT License
21 stars 6 forks source link

feat: Add temp path overload for DisposableFileSystem extensions #63

Closed MattKotsenas closed 7 months ago

MattKotsenas commented 7 months ago

The CreateDisposableFile / CreateDisposableDirectory extensions provide two overloads, one automatically creates a subdirectory under %TEMP%, and the other takes a string.

However, the overload that accepts a disposable factory only has one overload that requires a path. In order to make using the extension with custom disposables easier, also provide an overload that automatically creates a subdirectory under %TEMP%.

Also updated unit tests to cover the functionality.

gigi81 commented 7 months ago

Hi @MattKotsenas Ok for the new overloads. As for the tests, are you sure we are covering all the old and new overloads? Seems to me there are no new tests in the PR but just a refactoring of existing tests? Can you please let me know? Thanks

MattKotsenas commented 7 months ago

Hi there!

The new 3 parameter overloads call the old 4 parameter overloads, so from a coverage perspective they are covered.

From a pedantic perspective, we could add a test to make sure the path parameter is used (e.g. theoretically a future change could ignore path and always use temp). The old tests didn't assert that either, but I'm happy to add a new test that does.

Let me know what you prefer!

gigi81 commented 7 months ago

agreed. thanks. merging now.

github-actions[bot] commented 7 months ago

This is addressed in release v2.2.3.