Open nils-a opened 1 month ago
Cause of the problem:
When the FakeFileSystem
is created, it creates a FakeFileSystemTree
using the given ICakeEnvironment
:
The FakeFileSystemTree
checks whether environment.WorkingDirectory.IsRelative
is true and if so, it throws the exception:
Now, ICakeEnvironment.WorkingDirectory.IsRelative
is defined as:
PathHelper.IsPathRooted
relies on
And EnvironmentHelper.GetPlatformFamily
in turn checks, what the current system is. I.e. the system running the test, not the FakeEnvironment
that was defined in the test.
Thus, the WorkingDirectory
, which is defined in FakeEnvironment
as
is checked for IsRooted
on my linux system, and not on the FakeEnvironment
.
On my linux system, C:/Working
is not rooted. Thus, it is treated as relative, and the exception is thrown.
Prerequisites
Cake runner
Cake .NET Tool
Cake version
4.0.0
Operating system
Linux
Operating system architecture
64-Bit
CI Server
No response
What are you seeing?
demo code
error
What is expected?
I expect no error to occur.
Steps to Reproduce
Output log
No response