Skip to content

Commit

Permalink
Direct Test Execution fix
Browse files Browse the repository at this point in the history
Recent mocking changes broke this (mocktable / mockcallhistory initialization took place in Invoke-Pester).
  • Loading branch information
dlwyatt authored and nohwnd committed Jun 25, 2014
1 parent 01d5175 commit a9a42b1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Functions/Describe.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ param(
{
# User has executed a test script directly instead of calling Invoke-Pester
$Pester = New-PesterState -Path (Resolve-Path .) -TestNameFilter $null -TagFilter @() -SessionState $PSCmdlet.SessionState

$script:mockTable = @{}
$script:mockCallHistory = @()
}

if($Pester.TestNameFilter -and ($Name -notlike $Pester.TestNameFilter))
Expand Down
3 changes: 3 additions & 0 deletions Functions/InModuleScope.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ function InModuleScope
# User has executed a test script directly instead of calling Invoke-Pester

$Pester = New-PesterState -Path (Resolve-Path .) -TestNameFilter $null -TagFilter @() -SessionState $PSCmdlet.SessionState

$script:mockTable = @{}
$script:mockCallHistory = @()
}

try
Expand Down

0 comments on commit a9a42b1

Please sign in to comment.