Add all other common module files
This commit is contained in:
32
Tests/Project/Help.Tests.ps1
Normal file
32
Tests/Project/Help.Tests.ps1
Normal file
@@ -0,0 +1,32 @@
|
||||
$Script:ModuleName = 'LDTestFramework'
|
||||
$Script:ModuleRoot = Split-Path -Path $PSScriptRoot -Parent
|
||||
|
||||
Describe "Public commands have comment-based or external help" -Tags 'Build' {
|
||||
$functions = Get-Command -Module $ModuleName
|
||||
$help = foreach ($function in $functions) {
|
||||
Get-Help -Name $function.Name
|
||||
}
|
||||
|
||||
foreach ($node in $help)
|
||||
{
|
||||
Context $node.Name {
|
||||
It "Should have a Description or Synopsis" -Pending {
|
||||
($node.Description + $node.Synopsis) | Should Not BeNullOrEmpty
|
||||
}
|
||||
|
||||
It "Should have an Example" -Pending {
|
||||
$node.Examples | Should Not BeNullOrEmpty
|
||||
}
|
||||
|
||||
foreach ($parameter in $node.Parameters.Parameter)
|
||||
{
|
||||
if ($parameter -notmatch 'WhatIf|Confirm')
|
||||
{
|
||||
It "Should have a Description for Parameter [$($parameter.Name)]" -Pending {
|
||||
$parameter.Description.Text | Should Not BeNullOrEmpty
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user