From a8242f3192fa746208d2fe7c63810ac1f8131244 Mon Sep 17 00:00:00 2001 From: TheCakeIsNaOH Date: Tue, 20 Dec 2022 11:47:40 -0600 Subject: [PATCH] (#508) Enable tests with relative path sources --- .../scenarios/InfoScenarios.cs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/chocolatey.tests.integration/scenarios/InfoScenarios.cs b/src/chocolatey.tests.integration/scenarios/InfoScenarios.cs index 8f73b4abdc..61625e0ea5 100644 --- a/src/chocolatey.tests.integration/scenarios/InfoScenarios.cs +++ b/src/chocolatey.tests.integration/scenarios/InfoScenarios.cs @@ -67,7 +67,6 @@ public override void Because() } } - [Broken, Pending("Need to be fixed in either NuGet.Client or before calling code in NuGet.Client")] public class when_searching_for_exact_package_through_command : CommandScenariosBase { public override void Context() @@ -94,7 +93,7 @@ public void should_log_package_information() .ToShortDateString(); MockLogger.Messages.Keys.ShouldContain(LogLevel.Info.to_string()); - MockLogger.Messages[LogLevel.Info.to_string()].ShouldContain(" Title: installpackage | Published: 14.12.2022\r\n Number of Downloads: n/a | Downloads for this version: n/a\r\n Package url\r\n Chocolatey Package Source: n/a\r\n Tags: installpackage admin\r\n Software Site: n/a\r\n Software License: n/a\r\n Summary: __REPLACE__\r\n Description: __REPLACE__\r\n".format_with(lastWriteDate)); + MockLogger.Messages[LogLevel.Info.to_string()].ShouldContain(" Title: installpackage | Published: {0}\r\n Number of Downloads: n/a | Downloads for this version: n/a\r\n Package url\r\n Chocolatey Package Source: n/a\r\n Tags: installpackage admin\r\n Software Site: n/a\r\n Software License: n/a\r\n Summary: __REPLACE__\r\n Description: __REPLACE__\r\n".format_with(lastWriteDate)); } [Fact] @@ -105,7 +104,6 @@ public void should_log_package_count_as_warning() } } - [Broken, Pending("Need to be fixed in either NuGet.Client or before calling code in NuGet.Client")] public class when_searching_for_exact_package_with_dot_relative_path_source : when_searching_for_exact_package_through_command { public override void Context() @@ -143,7 +141,7 @@ public override void Because() .ToShortDateString(); MockLogger.Messages.Keys.ShouldContain(LogLevel.Info.to_string()); - MockLogger.Messages[LogLevel.Info.to_string()].ShouldContain(" Title: installpackage | Published: 14.12.2022\r\n Number of Downloads: n/a | Downloads for this version: n/a\r\n Package url\r\n Chocolatey Package Source: n/a\r\n Tags: installpackage admin\r\n Software Site: n/a\r\n Software License: n/a\r\n Summary: __REPLACE__\r\n Description: __REPLACE__\r\n".format_with(lastWriteDate)); + MockLogger.Messages[LogLevel.Info.to_string()].ShouldContain(" Title: installpackage | Published: {0}\r\n Number of Downloads: n/a | Downloads for this version: n/a\r\n Package url\r\n Chocolatey Package Source: n/a\r\n Tags: installpackage admin\r\n Software Site: n/a\r\n Software License: n/a\r\n Summary: __REPLACE__\r\n Description: __REPLACE__\r\n".format_with(lastWriteDate)); } [Fact] @@ -154,7 +152,6 @@ public override void Because() } } - [Broken, Pending("Need to be fixed in either NuGet.Client or before calling code in NuGet.Client")] public class when_searching_for_exact_package_with_verbose_output : ScenariosBase { public override void Context() @@ -193,7 +190,9 @@ public void should_report_expected_name() [Fact] public void should_set_source_to_expected_value() { - Results[0].Source.ShouldEqual("PackageOutput"); + Results[0].Source.ShouldEqual( + ("file:///" + Path.Combine(Environment.CurrentDirectory, "PackageOutput")) + .Replace("\\","/")); } [Fact]