Skip to content

Allow mocks to work with conflicting parameter names#1233

Merged
nohwnd merged 5 commits intopester:masterfrom
renehernandez:rename-conflicting-params-names
Feb 3, 2019
Merged

Allow mocks to work with conflicting parameter names#1233
nohwnd merged 5 commits intopester:masterfrom
renehernandez:rename-conflicting-params-names

Conversation

@renehernandez
Copy link
Copy Markdown
Contributor

1. General summary of the pull request

Fix #1007

Allow Mock to overcome names in parameters that shouldn't be used by prefixing them with the _ identifier.

@renehernandez renehernandez force-pushed the rename-conflicting-params-names branch from 04f15f5 to fb30102 Compare February 2, 2019 04:23
@renehernandez
Copy link
Copy Markdown
Contributor Author

@nohwnd the powershell 2 run failed before running the tests and it is not clear to why or where exactly. Any inputs?

Comment thread Functions/Mock.ps1 Outdated
Comment thread Functions/Mock.ps1
Comment thread Functions/Mock.ps1 Outdated
Comment thread Functions/Mock.ps1 Outdated
@nohwnd
Copy link
Copy Markdown
Member

nohwnd commented Feb 2, 2019

@renehernandez Thanks for your PR. 🙂 You have to use Mandatory = $true in posh v2, I described it better in the code review.

Rene Hernandez added 3 commits February 3, 2019 12:17
Remove prefix function
Replace pipeline usage by foreach
Use null assignment instead of out-null
R
Capture Remove method call in $null var
@nohwnd nohwnd merged commit d192974 into pester:master Feb 3, 2019
@nohwnd
Copy link
Copy Markdown
Member

nohwnd commented Feb 3, 2019

Merged! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SessionStateUnauthorizedAccessException when Mocking Get-Module

2 participants