From 55f1133dd7e0e7308c253aaa40766f8a44736df1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Breu=C3=9F?= Date: Sun, 1 Nov 2026 21:05:02 +0100 Subject: [PATCH] test: wrap a root drive in DriveInfo.Wrap test On the ubuntu-26.04 runner image the first drive is the mount point '/run', which the mock maps to its single root drive '/', so the test failed for reasons unrelated to the code under test. --- .../FileSystem/DriveInfoFactory/Tests.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Tests/Testably.Abstractions.Tests/FileSystem/DriveInfoFactory/Tests.cs b/Tests/Testably.Abstractions.Tests/FileSystem/DriveInfoFactory/Tests.cs index 1de967994..c99f17534 100644 --- a/Tests/Testably.Abstractions.Tests/FileSystem/DriveInfoFactory/Tests.cs +++ b/Tests/Testably.Abstractions.Tests/FileSystem/DriveInfoFactory/Tests.cs @@ -136,11 +136,13 @@ public async Task Wrap_ShouldReturnDriveInfoWithSameName() mockFileSystem.SimulationMode != SimulationMode.Native); Skip.If(Test.RunsOnMac, "GetDrives() can cause a native crash on macOS."); - System.IO.DriveInfo driveInfo = System.IO.DriveInfo.GetDrives()[0]; + System.IO.DriveInfo driveInfo = System.IO.DriveInfo.GetDrives() + .First(d => d.Name == System.IO.Path.GetPathRoot(d.Name)); IDriveInfo result = FileSystem.DriveInfo.Wrap(driveInfo); - await That(result.Name).IsEqualTo(driveInfo.Name); + await That(result.Name).IsEqualTo(driveInfo.Name) + .Because("the mock has no mount points like '/run' on Linux, so only a root drive keeps its name"); } [Test]