forked from adbertram/Random-PowerShell-Work
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Converted to function and added initial tests
- Loading branch information
Showing
2 changed files
with
415 additions
and
267 deletions.
There are no files selected for viewing
115 changes: 115 additions & 0 deletions
115
PowerShell Gallery/Publish-PowerShellGalleryModule.Tests.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
. .\Publish-PowerShellGalleryModule.ps1 | ||
|
||
$commandName = 'Publish-PowerShellGalleryModule' | ||
|
||
#region Mocks | ||
mock 'Test-Path' { | ||
$true | ||
} | ||
|
||
mock 'ShowMenu' | ||
|
||
mock 'PromptChoice' | ||
|
||
mock 'GetRequiredManifestKeyParams' { | ||
@{ | ||
Version = 'ver' | ||
Description = 'desc' | ||
Author = 'authorhere' | ||
ProjectUri = 'urihere' | ||
} | ||
} | ||
|
||
mock 'New-ModuleManifest' | ||
|
||
mock 'Test-ModuleManifest' { | ||
$true | ||
} | ||
|
||
mock 'Add-Content' | ||
|
||
mock 'Get-Module' { | ||
@{ | ||
Path = 'manifestpath' | ||
Description = 'deschere' | ||
Author = 'authhere' | ||
Version = 'verhere' | ||
LicenseUri = 'licurihere' | ||
} | ||
} | ||
|
||
mock 'Update-ModuleManifest' | ||
|
||
mock 'Publish-Module' | ||
|
||
mock 'Invoke-Test' | ||
#endregion | ||
|
||
it 'should run all optional tests if chosen' { | ||
& $commandName -ModuleFilePath 'C:\module.psm1' -RunOptionalTests | ||
|
||
|
||
} | ||
|
||
it 'should run all mandatory tests' { | ||
|
||
} | ||
|
||
it 'should call Publish-Module with the expected parameters' { | ||
|
||
} | ||
|
||
context 'When immediately publishing to the PowerShell Gallery' { | ||
|
||
it 'should call Publish-Module with the expected parameters' { | ||
|
||
} | ||
} | ||
|
||
context 'When no NuGet API key is passed' { | ||
|
||
it 'throws an exception' { | ||
s | ||
} | ||
} | ||
|
||
context 'When no module manifest exists' { | ||
|
||
it 'should run the fix action' { | ||
|
||
} | ||
} | ||
|
||
context 'When a module manifest exists but does not have required keys' { | ||
|
||
it 'should run the fix action' { | ||
|
||
} | ||
} | ||
|
||
context 'When no Pester tests are found' { | ||
|
||
it 'should run the fix action' { | ||
|
||
} | ||
|
||
it 'should create a describe block for each exported module function' { | ||
|
||
} | ||
} | ||
|
||
context 'When it does not pass Test-ModuleManifest' { | ||
|
||
it 'should run the fix action' { | ||
|
||
} | ||
} | ||
|
||
context 'When the module is not found' { | ||
|
||
it 'should throw an exception' { | ||
|
||
} | ||
} | ||
|
||
|
Oops, something went wrong.