-
-
Notifications
You must be signed in to change notification settings - Fork 477
Feature request for 'Should' to output a boolean value #1712
Copy link
Copy link
Open
Labels
Description
1. General summary of the issue
Would it be possible for Should to produce a boolean value so it can be used within the script block of -ParameterFilter available on Mock? See the example code below to clarify.
Describe '-ParameterFilter test' {
BeforeAll {
Function Test-Colors {
Param (
[String[]]$Colors
)
$Colors.Contains('Green')
}
Mock Test-Colors
Test-Colors -Colors @('Green', 'Red')
}
It "desired functionality" {
Should -invoke Test-Colors -Scope Describe -ParameterFilter {
$Colors | Should -Be @('Green', 'Red')
}
}
It "workaround" {
Should -invoke Test-Colors -Scope Describe -ParameterFilter {
$Colors | Should -Be @('Green', 'Red')
$true
}
}
}- Possible solution
Maybe it would be great if a switch could be added like:
@('apple', 'kiwi') | Should -Be -OutBoolean @('apple', 'kiwi')Reactions are currently unavailable