Skip to content
This repository has been archived by the owner on Feb 24, 2021. It is now read-only.

Restore-TestEnvironment remains PSModulePath added by Initialize-TestEnvironment #70

Closed
guitarrapc opened this issue Jul 30, 2016 · 2 comments
Assignees
Labels
bug The issue is a bug.

Comments

@guitarrapc
Copy link

Description of Issue

Restore-TestEnvironment could not handle Initialize-TestEnvironment added path.

Detail

Initialize-TestEnvironment adding current Test DSC Module's Root Path, which retrieved at here https://github.com/PowerShell/DscResource.Tests/blob/dev/TestHelper.psm1#L347, to the Machine's PSmodulePath at https://github.com/PowerShell/DscResource.Tests/blob/dev/TestHelper.psm1#L376

It's trying to pass $OldModulePath info, https://github.com/PowerShell/DscResource.Tests/blob/dev/TestHelper.psm1#L393 but ModuleRoot is remain afterRestore-TestEnvironment has ran.

Expectation

Should completely remove Test Module Path from PSModulePath.

@kwirkykat kwirkykat added the bug The issue is a bug. label Aug 3, 2016
@johlju
Copy link
Contributor

johlju commented Apr 23, 2018

Not sure this is still an issue, but let's keep this issue until we have written a unit/integration test for this.

@johlju johlju added the help wanted The issue is up for grabs for anyone in the community. label Apr 23, 2018
@johlju
Copy link
Contributor

johlju commented Aug 3, 2018

We should add a new test case for this, and Assert-MockCalled here, so that Set-PSModulePath is called with the correct path.

{ Restore-TestEnvironment -TestEnvironment $TestEnvironment } | Should -Not -Throw

johlju added a commit to johlju/DscResource.Tests that referenced this issue Aug 3, 2018
@johlju johlju self-assigned this Aug 3, 2018
johlju added a commit that referenced this issue Aug 3, 2018
@johlju johlju removed the help wanted The issue is up for grabs for anyone in the community. label Aug 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug The issue is a bug.
Projects
None yet
Development

No branches or pull requests

3 participants