Created
June 25, 2020 01:00
-
-
Save JeffBrownTech/ddb556c5b460e50928af08bf43b39203 to your computer and use it in GitHub Desktop.
Pester v5 Test Script for PSSomethingModule
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Import-Module .\PSSomethingModule.psm1 -Force | |
Describe "Get-Something" { | |
Context "when parameter ThingToGet is not used" { | |
It "should return 'I got something!'" { | |
Get-Something | Should -Be 'I got something!' | |
} | |
It "should be a string" { | |
Get-Something | Should -BeOfType System.String | |
} | |
} | |
Context "when parameter ThingToGet is used" { | |
It "should return 'I got ' follow by a string" { | |
$thing = 'a dog' | |
Get-Something -ThingToGet $thing | Should -Be "I got $thing!" | |
} | |
It "should be a string" { | |
Get-Something | Should -BeOfType System.String | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment