Skip to content

Commit

Permalink
(chocolatey#2236) Mono test work with merged usr systems
Browse files Browse the repository at this point in the history
The should_find_existing_executable() test has a hardcoded path to the
ls executable, which is incorrect on systems with a merged usr
directory, as they have binaries under /usr/bin instead of under /bin
Switches the test to work with both path.
  • Loading branch information
TheCakeIsNaOH committed Apr 16, 2021
1 parent deda8fe commit c80312b
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,14 @@ public override void Because()
[Fact]
public void GetExecutablePath_should_find_existing_executable()
{
FileSystem.get_executable_path("ls").ShouldEqual(
Platform.get_platform() != PlatformType.Windows
? "/bin/ls"
: "ls");
if (Platform.get_platform() == PlatformType.Windows)
{
FileSystem.get_executable_path("ls").ShouldEqual("ls");
}
else
{
FileSystem.get_executable_path("ls").ShouldBeInRange("/bin/ls", "/usr/bin/ls");
}
}

[Fact]
Expand Down

0 comments on commit c80312b

Please sign in to comment.