@@ -303,12 +303,10 @@ Describe "Build-Module" {
303
303
[IO.FileInfo ]" $TestDrive /MyModule/Public/Get-MyInfo.ps1"
304
304
}
305
305
306
- try {
307
- Build-Module - SemVer $SemVer
308
- } catch {
309
- Pop-Location - StackName BuildModuleTest
310
- throw
311
- }
306
+ Build-Module - SemVer $SemVer
307
+ }
308
+ AfterAll {
309
+ Pop-Location - StackName BuildModuleTest
312
310
}
313
311
314
312
It " Should build to an output folder with the simple version." {
@@ -336,12 +334,7 @@ Describe "Build-Module" {
336
334
# If there's no release notes, but it was left uncommented
337
335
Mock Get-Metadata { " " }
338
336
339
- try {
340
- Build-Module - SemVer $SemVer
341
- } catch {
342
- Pop-Location - StackName BuildModuleTest
343
- throw
344
- }
337
+ Build-Module - SemVer $SemVer
345
338
346
339
Assert-MockCalled Update-Metadata - ParameterFilter {
347
340
$PropertyName -eq " PrivateData.PSData.ReleaseNotes" -and $Value -eq " MyModule v$SemVer "
@@ -354,12 +347,7 @@ Describe "Build-Module" {
354
347
Multi-line Release Notes
355
348
With a prefix carriage return" }
356
349
357
- try {
358
- Build-Module - SemVer $SemVer
359
- } catch {
360
- Pop-Location - StackName BuildModuleTest
361
- throw
362
- }
350
+ Build-Module - SemVer $SemVer
363
351
364
352
Assert-MockCalled Update-Metadata - ParameterFilter {
365
353
$PropertyName -eq " PrivateData.PSData.ReleaseNotes" -and $Value -eq "
@@ -368,9 +356,6 @@ Describe "Build-Module" {
368
356
With a prefix carriage return"
369
357
}
370
358
}
371
- AfterAll {
372
- Pop-Location - StackName BuildModuleTest
373
- }
374
359
}
375
360
376
361
Context " Setting the version and pre-release" {
@@ -414,12 +399,11 @@ Describe "Build-Module" {
414
399
[IO.FileInfo ]" $TestDrive /MyModule/Public/Get-MyInfo.ps1"
415
400
}
416
401
417
- try {
418
- Build-Module @SemVer
419
- } catch {
420
- Pop-Location - StackName BuildModuleTest
421
- throw
422
- }
402
+ Build-Module @SemVer
403
+ }
404
+
405
+ AfterAll {
406
+ Pop-Location - StackName BuildModuleTest
423
407
}
424
408
425
409
It " Should build to an output folder with the simple version." {
@@ -448,12 +432,7 @@ Describe "Build-Module" {
448
432
# If there's no release notes, but it was left uncommented
449
433
Mock Get-Metadata { " " }
450
434
451
- try {
452
- Build-Module @SemVer
453
- } catch {
454
- Pop-Location - StackName BuildModuleTest
455
- throw
456
- }
435
+ Build-Module @SemVer
457
436
458
437
Assert-MockCalled Update-Metadata - ParameterFilter {
459
438
$PropertyName -eq " PrivateData.PSData.ReleaseNotes" -and
@@ -467,12 +446,7 @@ Describe "Build-Module" {
467
446
Multi-line Release Notes
468
447
With a prefix carriage return" }
469
448
470
- try {
471
- Build-Module @SemVer
472
- } catch {
473
- Pop-Location - StackName BuildModuleTest
474
- throw
475
- }
449
+ Build-Module @SemVer
476
450
477
451
Assert-MockCalled Update-Metadata - ParameterFilter {
478
452
$PropertyName -eq " PrivateData.PSData.ReleaseNotes" -and $Value -eq "
@@ -481,9 +455,6 @@ Describe "Build-Module" {
481
455
With a prefix carriage return"
482
456
}
483
457
}
484
- AfterAll {
485
- Pop-Location - StackName BuildModuleTest
486
- }
487
458
}
488
459
489
460
Context " Setting the version with no pre-release" {
@@ -518,12 +489,10 @@ Describe "Build-Module" {
518
489
[IO.FileInfo ]" $TestDrive /MyModule/Public/Get-MyInfo.ps1"
519
490
}
520
491
521
- try {
522
- Build-Module @SemVer
523
- } catch {
524
- Pop-Location - StackName BuildModuleTest
525
- throw
526
- }
492
+ Build-Module @SemVer
493
+ }
494
+ AfterAll {
495
+ Pop-Location - StackName BuildModuleTest
527
496
}
528
497
529
498
It " Should build to an output folder with the simple version." {
@@ -541,9 +510,6 @@ Describe "Build-Module" {
541
510
$PropertyName -eq " PrivateData.PSData.Prerelease"
542
511
} - Scope Context
543
512
}
544
- AfterAll {
545
- Pop-Location - StackName BuildModuleTest
546
- }
547
513
}
548
514
549
515
Context " Bug #70 Cannot build 1.2.3-pre-release" {
0 commit comments