-
Notifications
You must be signed in to change notification settings - Fork 1
/
publicApi.Tests.ps1
34 lines (33 loc) · 1.11 KB
/
publicApi.Tests.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
Get-Module Bootstraps | Remove-Module
Import-Module "$PSScriptRoot\Bootstraps.psm1"
Describe 'Public API' {
$commands = Get-Command -Module Bootstraps |
? {$_.Name -ne 'Get-7d4176b6'}
It 'exports some functions...' {
$commands | measure | % Count | Should beGreaterThan 4
}
It '...but not too many' {
$commands | measure | % Count | Should beLessThan 12
}
Context 'help' {
foreach ( $command in $commands )
{
Context $command.Name {
$help = $command | Get-Help
It 'has a synopsis' {
$help.Synopsis | Should not match $command.Name
}
It 'has a description' {
$help.Description | Should not beNullOrEmpty
}
It 'parameter <n> has a description' -TestCases @(
$help.parameters.parameter |
% { @{ n=$_.Name; p=$_ } }
) {
param($n,$p)
$p.Description | Should not beNullOrEmpty
}
}
}
}
}