Test Updates

This commit is contained in:
Wes Carroll
2019-03-27 18:19:31 -04:00
parent bbcbb4a970
commit 9ff003bbe0
2 changed files with 13 additions and 2 deletions
+12 -1
View File
@@ -1,7 +1,7 @@
$moduleName = "ZertoApiWrapper"
$moduleFileName = "ZertoApiWrapper.psm1"
$filePath = (Split-Path -Parent $MyInvocation.MyCommand.Path) -replace 'Tests', 'ZertoApiWrapper'
$docsPath = (Split-Path -Parent $MyInvocation.MyCommand.Path) -replace 'Tests/Public', 'docs'
$docsPath = (Split-Path -Parent $MyInvocation.MyCommand.Path) -replace 'Tests[\\\/]Public', 'docs'
$fileName = (Split-Path -Leaf $MyInvocation.MyCommand.Path ) -replace '.Tests.', '.'
$modulePath = $filePath -replace "Public", ""
$userName = "zerto\build"
@@ -25,6 +25,17 @@ Describe "File Tests" {
it "$command is backed by a file with the same name" {
$path | should exist
}
it "$command file has openbraces on the same line as the statement" {
$content = Get-Content -Path $path
$openingBracesExist = $content | Where-Object {$_.Trim() -eq '{'}
if ($openingBracesExist) {
Write-Warning "Found the following opening brances on their own line:"
foreach ($openingBrace in $openingBracesExist) {
Write-Warning "Opening Brace on it's own line - $openingBrace"
}
}
$openingBracesExist | should benullorempty
}
it "$command has an external help file" {
$externalHelpFile | should exist
}