Skip to content

Commit

Permalink
(#3381) Add Pester tests for rule tab expansion
Browse files Browse the repository at this point in the history
This commit adds some Pester tests to ensure that the output for the
rule command, during tab expansion, works as expected.
  • Loading branch information
gep13 committed May 22, 2024
1 parent cab723c commit 681e4e6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/pester-tests/chocolateyProfile.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,16 @@ Describe "Chocolatey Profile" -Tag Chocolatey, Profile, Environment {
$Completions[1] | Should -Be "info"
$Completions[2] | Should -Be "-?"
$Completions[3] | Should -Be "--name=''"

It "Should list completions for rule" {
$Command = "choco rule "
$Completions = (TabExpansion2 -inputScript $Command -cursorColumn $Command.Length).CompletionMatches.CompletionText

$becauseCompletions = ($Completions -Join ", ")

$Completions | Should -Contain "--name=''" -Because $becauseCompletions
}

}
}
}

0 comments on commit 681e4e6

Please sign in to comment.