Skip to content

Instantly share code, notes, and snippets.

@Splaxi
Forked from SQLDBAWithABeard/testing examples code
Created October 8, 2018 06:38
Show Gist options
  • Save Splaxi/08b55e304c65e61d736d9f9721bd657f to your computer and use it in GitHub Desktop.
Save Splaxi/08b55e304c65e61d736d9f9721bd657f to your computer and use it in GitHub Desktop.
testiong examples code
$Function = 'Get-DbcCheck'
Describe "$Function" {
Context "Checking $Function Examples" {
$Examples = Get-Help $Function -Examples
foreach ($examplecode in $Examples.examples.example.Code) {
It "Example Code $examplecode should not throw" {
{$examplecode} | Should -Not -Throw
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment