Created
January 7, 2019 18:02
-
-
Save nohwnd/ba4f9d7a12b9ca1f0cef568fd7a50044 to your computer and use it in GitHub Desktop.
Adding a filter to It via wrapper
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ItWithTag ( | |
$Name, | |
$Body, | |
$Tag | |
) { | |
if ($null -eq $global:Tags -or 0 -eq $global:Tags.Length -or $global:Tags -contains $Tag) { | |
It $Name $Body | |
} | |
} | |
$global:tags = @("t") | |
Describe "a" { | |
Write-Host d1 | |
ItWithTag "does not run" { | |
Write-Host t1 | |
} | |
ItWithTag "runs" -Tag "t" { | |
Write-Host t2 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment