Skip to content

Commit 0e7b369

Browse files
committed
(#508) Enable tests with relative path sources
1 parent dde3671 commit 0e7b369

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Diff for: src/chocolatey.tests.integration/scenarios/InfoScenarios.cs

+6-6
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ namespace chocolatey.tests.integration.scenarios
1010
using chocolatey.infrastructure.app.configuration;
1111
using chocolatey.infrastructure.app.services;
1212
using chocolatey.infrastructure.commands;
13+
using chocolatey.infrastructure.platforms;
1314
using chocolatey.infrastructure.results;
1415

1516
using NuGet;
@@ -67,7 +68,6 @@ public override void Because()
6768
}
6869
}
6970

70-
[Broken, Pending("Need to be fixed in either NuGet.Client or before calling code in NuGet.Client")]
7171
public class when_searching_for_exact_package_through_command : CommandScenariosBase
7272
{
7373
public override void Context()
@@ -94,7 +94,7 @@ public void should_log_package_information()
9494
.ToShortDateString();
9595

9696
MockLogger.Messages.Keys.ShouldContain(LogLevel.Info.to_string());
97-
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));
97+
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));
9898
}
9999

100100
[Fact]
@@ -105,7 +105,6 @@ public void should_log_package_count_as_warning()
105105
}
106106
}
107107

108-
[Broken, Pending("Need to be fixed in either NuGet.Client or before calling code in NuGet.Client")]
109108
public class when_searching_for_exact_package_with_dot_relative_path_source : when_searching_for_exact_package_through_command
110109
{
111110
public override void Context()
@@ -143,7 +142,7 @@ public override void Because()
143142
.ToShortDateString();
144143

145144
MockLogger.Messages.Keys.ShouldContain(LogLevel.Info.to_string());
146-
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));
145+
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));
147146
}
148147

149148
[Fact]
@@ -154,7 +153,6 @@ public override void Because()
154153
}
155154
}
156155

157-
[Broken, Pending("Need to be fixed in either NuGet.Client or before calling code in NuGet.Client")]
158156
public class when_searching_for_exact_package_with_verbose_output : ScenariosBase
159157
{
160158
public override void Context()
@@ -193,7 +191,9 @@ public void should_report_expected_name()
193191
[Fact]
194192
public void should_set_source_to_expected_value()
195193
{
196-
Results[0].Source.ShouldEqual("PackageOutput");
194+
Results[0].Source.ShouldEqual(
195+
((Platform.get_platform() == PlatformType.Windows ? "file:///" : "file://") + Path.Combine(Environment.CurrentDirectory, "PackageOutput"))
196+
.Replace("\\","/"));
197197
}
198198

199199
[Fact]

0 commit comments

Comments
 (0)