Skip to content

Commit 8443abf

Browse files
committed
Add test to its own context block
1 parent b3ef54a commit 8443abf

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Tests/Engine/InvokeScriptAnalyzer.tests.ps1

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,13 @@ Describe "Test Path" {
126126
$withoutPath = Invoke-ScriptAnalyzer -Path $scriptPath
127127
$withPath.Count | Should -Be $withoutPath.Count
128128
}
129+
}
129130

130-
It "Runs rules on script with more than 10 parser errors" {
131+
Context "When there are more than 10 errors in a file" {
132+
It "All errors are found in a file" {
131133
# this is a script with 12 parse errors
132-
1..12 | Foreach-Object { ');' } | Out-File -Encoding ASCII "TestDrive:\badfile.ps1"
133-
$moreThanTenErrors = Invoke-ScriptAnalyzer -Path "TestDrive:\badfile.ps1"
134+
1..12 | Foreach-Object { ');' } | Out-File -Encoding ASCII "${TestDrive}\badfile.ps1"
135+
$moreThanTenErrors = Invoke-ScriptAnalyzer -Path "${TestDrive}\badfile.ps1"
134136
@($moreThanTenErrors).Count | Should -Be 12
135137
}
136138
}

0 commit comments

Comments
 (0)