Skip to content

Instantly share code, notes, and snippets.

@JeffBrownTech
Created June 25, 2020 01:00
Show Gist options
  • Save JeffBrownTech/ddb556c5b460e50928af08bf43b39203 to your computer and use it in GitHub Desktop.
Save JeffBrownTech/ddb556c5b460e50928af08bf43b39203 to your computer and use it in GitHub Desktop.
Pester v5 Test Script for PSSomethingModule
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