@@ -391,7 +391,7 @@ public void ShouldHandleLocalNuGetConfigWithRelativePath()
391
391
392
392
using ( var packageLibraryFolder = new DisposableFolder ( ) )
393
393
{
394
- CreateTestPackage ( packageLibraryFolder ) ;
394
+ CreateTestPackage ( packageLibraryFolder . Path ) ;
395
395
396
396
string pathToScriptFile = CreateTestScript ( packageLibraryFolder . Path ) ;
397
397
@@ -407,7 +407,7 @@ public void ShouldHandleLocalNuGetConfigWithRelativePathInParentFolder()
407
407
408
408
using ( var packageLibraryFolder = new DisposableFolder ( ) )
409
409
{
410
- CreateTestPackage ( packageLibraryFolder ) ;
410
+ CreateTestPackage ( packageLibraryFolder . Path ) ;
411
411
412
412
var scriptFolder = Path . Combine ( packageLibraryFolder . Path , "ScriptFolder" ) ;
413
413
Directory . CreateDirectory ( scriptFolder ) ;
@@ -418,6 +418,26 @@ public void ShouldHandleLocalNuGetConfigWithRelativePathInParentFolder()
418
418
}
419
419
}
420
420
421
+ [ Fact ]
422
+ public void ShouldHandleLocalNuGetFileWhenPathContainsSpace ( )
423
+ {
424
+ TestPathUtils . RemovePackageFromGlobalNugetCache ( "NuGetConfigTestLibrary" ) ;
425
+
426
+ using ( var packageLibraryFolder = new DisposableFolder ( ) )
427
+ {
428
+ var packageLibraryFolderPath = Path . Combine ( packageLibraryFolder . Path , "library folder" ) ;
429
+ Directory . CreateDirectory ( packageLibraryFolderPath ) ;
430
+
431
+ CreateTestPackage ( packageLibraryFolderPath ) ;
432
+
433
+ string pathToScriptFile = CreateTestScript ( packageLibraryFolderPath ) ;
434
+
435
+ var result = ScriptTestRunner . Default . Execute ( $ "\" { pathToScriptFile } \" ") ;
436
+ Assert . Contains ( "Success" , result . output ) ;
437
+ }
438
+ }
439
+
440
+
421
441
private static string CreateTestScript ( string scriptFolder )
422
442
{
423
443
string script = @"
@@ -429,11 +449,16 @@ private static string CreateTestScript(string scriptFolder)
429
449
return pathToScriptFile ;
430
450
}
431
451
432
- private static void CreateTestPackage ( DisposableFolder packageLibraryFolder )
452
+ private static void CreateTestPackage ( string packageLibraryFolder )
453
+ {
454
+ ProcessHelper . RunAndCaptureOutput ( "dotnet" , "new classlib -n NuGetConfigTestLibrary" , packageLibraryFolder ) ;
455
+ var projectFolder = Path . Combine ( packageLibraryFolder , "NuGetConfigTestLibrary" ) ;
456
+ ProcessHelper . RunAndCaptureOutput ( "dotnet" , $ "pack -o \" { Path . Combine ( packageLibraryFolder , "packagePath" ) } \" ", projectFolder ) ;
457
+ CreateNuGetConfig ( packageLibraryFolder ) ;
458
+ }
459
+
460
+ private static void CreateNuGetConfig ( string packageLibraryFolder )
433
461
{
434
- ProcessHelper . RunAndCaptureOutput ( "dotnet" , "new classlib -n NuGetConfigTestLibrary" , packageLibraryFolder . Path ) ;
435
- var projectFolder = Path . Combine ( packageLibraryFolder . Path , "NuGetConfigTestLibrary" ) ;
436
- ProcessHelper . RunAndCaptureOutput ( "dotnet" , $ "pack -o { Path . Combine ( packageLibraryFolder . Path , "packagePath" ) } ", projectFolder ) ;
437
462
string nugetConfig = @"
438
463
<configuration>
439
464
<packageSources>
@@ -442,7 +467,7 @@ private static void CreateTestPackage(DisposableFolder packageLibraryFolder)
442
467
</packageSources>
443
468
></configuration>
444
469
" ;
445
- File . WriteAllText ( Path . Combine ( packageLibraryFolder . Path , "NuGet.Config" ) , nugetConfig ) ;
470
+ File . WriteAllText ( Path . Combine ( packageLibraryFolder , "NuGet.Config" ) , nugetConfig ) ;
446
471
}
447
472
}
448
473
}
0 commit comments