Skip to content

Commit

Permalink
Fix for pester#353
Browse files Browse the repository at this point in the history
$ArgumentList variable renamed to something that's extremely unlikely to conflict with an actual parameter name.
  • Loading branch information
dlwyatt committed May 18, 2015
1 parent c7c83d6 commit c37c87b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Functions/Mock.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -740,10 +740,10 @@ function MockPrototype {
[string] $IgnoreErrorPreference = 'SilentlyContinue'
}

[object] $ArgumentList = Get-Variable -Name args -ValueOnly -Scope Local -ErrorAction $IgnoreErrorPreference
if ($null -eq $ArgumentList) { $ArgumentList = @() }
[object] ${a r g s} = Get-Variable -Name args -ValueOnly -Scope Local -ErrorAction $IgnoreErrorPreference
if ($null -eq ${a r g s}) { ${a r g s} = @() }

Invoke-Mock -CommandName '#FUNCTIONNAME#' -ModuleName '#MODULENAME#' -BoundParameters $PSBoundParameters -ArgumentList $ArgumentList
Invoke-Mock -CommandName '#FUNCTIONNAME#' -ModuleName '#MODULENAME#' -BoundParameters $PSBoundParameters -ArgumentList ${a r g s}
}

function Invoke-Mock {
Expand Down

0 comments on commit c37c87b

Please sign in to comment.