Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial fix for #286 #323

Merged
merged 2 commits into from
Apr 28, 2015
Merged

Initial fix for #286 #323

merged 2 commits into from
Apr 28, 2015

Conversation

dlwyatt
Copy link
Member

@dlwyatt dlwyatt commented Apr 25, 2015

This works, but there might be some weirdness that can still happen if you mock a global function in conjunction with -ModuleName or InModuleScope. (The global function gets renamed for the duration of the mock, but the mock is only available from that single module. You can't mock the same global function from two different modules at once.)

Not sure if it's worth worrying about that edge case, since this "mocking global functions" scenario is already pretty rare to begin with.

Creating the PR to start discussion on this fix.

This works, but there might be some weirdness that can still happen if you mock a global function in conjunction with -ModuleName or InModuleScope.  (The global function gets renamed for the duration of the mock, but the mock is only available from that single module.  You can't mock the same global function from two different modules at once.)

Not sure if it's worth worrying about that edge case, since this "mocking global functions" scenario  is already pretty rare to begin with.
dlwyatt added a commit that referenced this pull request Apr 28, 2015
@dlwyatt dlwyatt merged commit 4625759 into pester:master Apr 28, 2015
@dlwyatt dlwyatt deleted the GlobalFunctionMock branch April 28, 2015 16:58
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.

1 participant