The Tag applies to Describe which may work. Another method is to use the Pending switch of It. Examples of everything I could think of follows. The code is just to have "something" for the tests to do.
On reflection I suspect Pending might be the better choice, but it depends a little how broad you need it to be.
Is this what you had in mind?
function Test-Prime {
[CmdletBinding()]
param(
[Parameter(ValueFromPipeline = $true)]
[Int]$Value,
[Switch]$AsValue
)
begin {
$isFalse = $false
$isTrue = $true
}
process {
if ($AsValue) {
$isFalse = $null
$isTrue = $Value
}
if ($Value -lt 2) {
return $isFalse
}
if (($Value -band 1) -eq 0) {
if ($Value -eq 2) {
return $isTrue
} else {
return $isFalse
}
} else {
for ($i = 3; ($i * $i) -le $Value; $i += 2) {
if ($Value % $i -eq 0) {
return $isFalse
}
}
return $isTrue
}
}
}
Describe Test-Prime {
It 'Returns false when passed a number less than 2' {
Test-Prime 1 | Should Be $false
Test-Prime 0 | Should Be $false
Test-Prime -1 | Should Be $false
Test-Prime -2 | Should Be $false
}
It 'Returns true when 2 is passed' {
Test-Prime 2 | Should Be $true
}
# Mark It as pending, perhaps because the test case was
# nothing more than a quick note
It 'Returns true when a larger prime is passed' -Pending {
Test-Prime 25 | Should Be $false
}
# Mark It with skip, it'll show, but it won't count without
# strict
It 'Returns false when an even number is passed' -Skip {
Test-Prime 100 | Should Be $false
}
# Or don't fill in the body (similar to Pending, same output)
It 'Does something else I meant to talk about' {
}
}
# Tag Describe with TODO
Describe Test-Prime -Tag TODO {
It 'Returns the original number when AsValue is used' {
Test-Prime 7 -AsValue | Should Be 7
}
}
# When invoking pester
Invoke-Pester -ExcludeTag TODO