-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Add LocationChangedAction handler and tests to support the Windows Compat module. #7552
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
Conversation
iSazonov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BrucePay Please address CodeFactor issues for your new code and public comments.
| (Get-Variable newPath).Value = $_.newPath | ||
| } | ||
| Set-Location .. | ||
| $newPath.Path | Should Be $pwd.Path |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use new Pester syntax - Should -Be.
Below too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops. Yeah - I'll fix that. Thanks.
rjmholt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me, modulo @iSazonov's Pester comment
…uld -Be' in the tests.
| Set-Location .. | ||
| $ExecutionContext.InvokeCommand.LocationChangedAction = { throw "Boom" } | ||
| # Verify that the exception occurred | ||
| { Set-Location $location } | Should Throw "Boom" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally this should be Should -Throw -ErrorId "Boom" here
iSazonov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with one comment about -Throw.
|
@TravisEz13 This looks read for merge. |
PR Summary
Fix for #7551. Implemented a new action
LocationChangedActionthat fires when the current directory in a runspace is changed.PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:to the beginning of the title and remove the prefix when the PR is ready.[feature]if the change is significant or affects feature tests