Update Method to Grab Path

https://jakubjares.com/2020/04/11/pester5-importing-ps-files/
This commit is contained in:
Wes Carroll
2020-04-20 16:35:02 -04:00
parent 71610ce9fe
commit 6620246e4c
107 changed files with 273 additions and 273 deletions
+10 -10
View File
@@ -1,6 +1,6 @@
#Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0]
$global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' {
@@ -16,7 +16,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
{ Get-ZertoApiFilter -filtertable $null } | Should Throw
}
it "should have an Output type of String" {
It "should have an Output type of String" {
(Get-Command $global:function).OutputType.Name | Should -Match "String"
}
}
@@ -47,19 +47,19 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
}
}
it "converts bool to text" {
Get-ZertoApiFilter -filtertable $singleBoolItemTest | should -Be "?BoolItem=True"
It "converts bool to text" {
Get-ZertoApiFilter -filtertable $singleBoolItemTest | Should -Be "?BoolItem=True"
}
it "one item test" {
Get-ZertoApiFilter -filtertable $oneItemTest | should -Be "?OneItem=Test"
It "one item test" {
Get-ZertoApiFilter -filtertable $oneItemTest | Should -Be "?OneItem=Test"
}
it "should ignore CommonParameters" {
Get-ZertoApiFilter -filtertable $commonParamTest | should -Be "?OneItem=Test"
It "should ignore CommonParameters" {
Get-ZertoApiFilter -filtertable $commonParamTest | Should -Be "?OneItem=Test"
}
it "should process a filter table with more than one item" {
It "should process a filter table with more than one item" {
$returnString = Get-ZertoApiFilter -filtertable $twoItemTest
$returnString | Should -match "^\?"
$returnString | Should -match "&"