Created
December 12, 2018 15:54
-
-
Save nohwnd/3ab59610d328efe4f862fb0951f70fe0 to your computer and use it in GitHub Desktop.
Shared state between DSL keywords in Pester
This file contains 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
# in module scope | |
$script:pester | |
function describe () { | |
$script:pester.EnterBlock("describe") | |
} | |
function it () { | |
if ($script:pester.Block -ne "Describe") { | |
throw "it can only be in describe" | |
} | |
$script:pester.EnterBlock("it") | |
} | |
function should () { | |
if ($script:pester.Block -ne "It") { | |
throw "should can only be in it" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment