pester/Pester — pull request #206 by dlwyatt (2014-09-03 00:52:04+00:00)
Title: Mocking fix

Test-ParameterFilter no longer reconstructs the original mocked command's CmdletBinding, Param or DynamicParam blocks. There's no need, since we've already done in that in the bootstrap function and passed along the $PSBoundParameters table anyway.

By reconstructing a basic param block which only contains the parameters that were actually bound, we avoid a problem with evaluating the DynamicParam block outside of the mocked function's original scope. If that DynamicParam block happened to refer to variables that only exist in a module's scope, it would produce an error.