-
Notifications
You must be signed in to change notification settings - Fork 8.1k
update test framework and tests to support 4x version of Pester #6064
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
Changes from all commits
7d14e24
0bbf9c5
59c3333
69467a4
86bd7d7
3f8df89
fc368ba
9cc7e8f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,7 +42,7 @@ | |
|
|
||
| It "should only load the specified version" { | ||
| Import-Module TestModule -RequiredVersion 1.1 | ||
| (Get-Module TestModule).Version | Should Be "1.1" | ||
| (Get-Module TestModule).Version | Should BeIn "1.1" | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -192,7 +192,7 @@ Describe "Import-Module should be case insensitive" -Tags 'CI' { | |
| Import-Module testMODULE | ||
| $m = Get-Module TESTmodule | ||
| $m | Should BeOfType "System.Management.Automation.PSModuleInfo" | ||
| $m.Name | Should Be "TESTMODULE" | ||
| $m.Name | Should BeIn "TESTMODULE" | ||
|
||
| mytest | Should BeExactly "hello" | ||
| Remove-Module TestModule | ||
| Get-Module tESTmODULE | Should BeNullOrEmpty | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -67,7 +67,8 @@ Describe "Invoke-Item basic tests" -Tags "Feature" { | |
| Get-Process -Name $notepadProcessName | Stop-Process -Force | ||
| Invoke-Item -Path $notepad | ||
| $notepadProcess = Get-Process -Name $notepadProcessName | ||
| $notepadProcess.Name | Should Be $notepadProcessName | ||
| # we need BeIn because multiple notepad processes could be running | ||
| $notepadProcess.Name | Should BeIn $notepadProcessName | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In line 67 we kill all notepad processes.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. in CI this is probably ok - on a dev box, not so much - the fix for this should be part of the generalized test review |
||
| Stop-Process -InputObject $notepadProcess | ||
| } | ||
| } else { | ||
|
|
||
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.
Isn't
BeInonly used for validating if the left side is contained in the collection on the right side? Don't understand why this isn't justBe?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.
as it turns out, there are multiple loaded modules which are named TestModule, thus a comparison with "Be" fails because it's a collection. I didn't want to rearchitect the tests.
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.
Got it. Closed.