Created
November 7, 2014 22:13
-
-
Save gpduck/82cbf879260d5bed2f33 to your computer and use it in GitHub Desktop.
Testing a script file in a module
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 Some-Function { | |
} | |
Export-ModuleMember -Function Some-Function |
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
$here = Split-Path -Parent $MyInvocation.MyCommand.Path | |
$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") | |
Describe "Some-Function" { | |
Mock "Export-ModuleMember" -ParameterFilter { $Function -eq "Some-Function" } -Verifiable | |
#I've moved this down here, is this OK? | |
. "$here\$sut" | |
Context "Other Tests" { | |
It "has other functionality" { | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment