diff --git a/src/pester-tests/Test-Environment-Variables.Tests.ps1 b/src/pester-tests/Test-Environment-Variables.Tests.ps1 index 95147099e4..9258252eab 100644 --- a/src/pester-tests/Test-Environment-Variables.Tests.ps1 +++ b/src/pester-tests/Test-Environment-Variables.Tests.ps1 @@ -1,8 +1,4 @@ -$here = Split-Path -Parent $MyInvocation.MyCommand.Path -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -. "$here/$sut" - -Describe "Test-Environment-Variables" { +Describe "Test-Environment-Variables" { It "Should have environment variable" { Get-Item ENV: | Should Not BeNullOrEmpty } diff --git a/src/pester-tests/Test-Get-Alias.Tests.ps1 b/src/pester-tests/Test-Get-Alias.Tests.ps1 index 0819dcaa4c..ce998c002f 100644 --- a/src/pester-tests/Test-Get-Alias.Tests.ps1 +++ b/src/pester-tests/Test-Get-Alias.Tests.ps1 @@ -1,41 +1,37 @@ -$here = Split-Path -Parent $MyInvocation.MyCommand.Path -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -. "$here/$sut" - -Describe "Get-Alias" { +Describe "Get-Alias" { It "Should have a return type of System.Array when gal returns more than one object" { - $val1=(Get-Alias a*) - $val2=(Get-Alias c*) - $i=0 + $val1=(Get-Alias a*) + $val2=(Get-Alias c*) + $i=0 - $val1 | ForEach-Object{ $i++}; - if($i -lt 2) { - $val1.GetType().BaseType.FullName | Should Be "System.Management.Automation.CommandInfo" - } - else { - $val1.GetType().BaseType.FullName | Should Be "System.Array" - } + $val1 | ForEach-Object{ $i++}; + if($i -lt 2) { + $val1.GetType().BaseType.FullName | Should Be "System.Management.Automation.CommandInfo" + } + else { + $val1.GetType().BaseType.FullName | Should Be "System.Array" + } - $val2 | ForEach-Object{ $i++}; - if($i -lt 2) { - $val2.GetType().BaseType.FullName | Should Be "System.Management.Automation.CommandInfo" - } - else { - $val2.GetType().BaseType.FullName | Should Be "System.Array" - } + $val2 | ForEach-Object{ $i++}; + if($i -lt 2) { + $val2.GetType().BaseType.FullName | Should Be "System.Management.Automation.CommandInfo" + } + else { + $val2.GetType().BaseType.FullName | Should Be "System.Array" + } - } + } - It "should return an array of 3 objects" { - $val = Get-Alias a* - $alias = gal a* + It "should return an array of 3 objects" { + $val = Get-Alias a* + $alias = gal a* - $val.CommandType | Should Not BeNullOrEmpty - $val.Name | Should Not BeNullOrEmpty - $val.ModuleName | Should BeNullOrEmpty + $val.CommandType | Should Not BeNullOrEmpty + $val.Name | Should Not BeNullOrEmpty + $val.ModuleName | Should BeNullOrEmpty - $alias.CommandType | Should Not BeNullOrEmpty - $alias.Name | Should Not BeNullOrEmpty - $alias.ModuleName | Should BeNullOrEmpty + $alias.CommandType | Should Not BeNullOrEmpty + $alias.Name | Should Not BeNullOrEmpty + $alias.ModuleName | Should BeNullOrEmpty } } diff --git a/src/pester-tests/Test-Get-ChildItem.Tests.ps1 b/src/pester-tests/Test-Get-ChildItem.Tests.ps1 index 7179c7b16d..b67362fe92 100644 --- a/src/pester-tests/Test-Get-ChildItem.Tests.ps1 +++ b/src/pester-tests/Test-Get-ChildItem.Tests.ps1 @@ -1,6 +1,6 @@ -$here = Split-Path -Parent $MyInvocation.MyCommand.Path -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -. "$here/$sut" + + + Describe "Test-Get-ChildItem" { It "Should list the contents of the current folder" { diff --git a/src/pester-tests/Test-Get-Content.Tests.ps1 b/src/pester-tests/Test-Get-Content.Tests.ps1 index f6e09e71c8..2c76206bb6 100644 --- a/src/pester-tests/Test-Get-Content.Tests.ps1 +++ b/src/pester-tests/Test-Get-Content.Tests.ps1 @@ -1,6 +1,6 @@ -$here = Split-Path -Parent $MyInvocation.MyCommand.Path -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -. "$here/$sut" + + + Describe "Test-Get-Content" { It "Should throw an error on a directory " { diff --git a/src/pester-tests/Test-Get-Dates.Tests.ps1 b/src/pester-tests/Test-Get-Dates.Tests.ps1 index 5761c2d54e..4516b72409 100644 --- a/src/pester-tests/Test-Get-Dates.Tests.ps1 +++ b/src/pester-tests/Test-Get-Dates.Tests.ps1 @@ -1,6 +1,6 @@ -$here = Split-Path -Parent $MyInvocation.MyCommand.Path -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -. "$here/$sut" + + + Describe "Test-Get-Date" { <# diff --git a/src/pester-tests/Test-Get-Item.Tests.ps1 b/src/pester-tests/Test-Get-Item.Tests.ps1 index ea265c0508..c809a3683e 100644 --- a/src/pester-tests/Test-Get-Item.Tests.ps1 +++ b/src/pester-tests/Test-Get-Item.Tests.ps1 @@ -1,6 +1,6 @@ -$here = Split-Path -Parent $MyInvocation.MyCommand.Path -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -. "$here/$sut" + + + Describe "Test-Get-Item" { It "Should list all the items in the current working directory when asterisk is used" { diff --git a/src/pester-tests/Test-Get-Location.Tests.ps1 b/src/pester-tests/Test-Get-Location.Tests.ps1 index 93ea706b42..2032dd8c25 100644 --- a/src/pester-tests/Test-Get-Location.Tests.ps1 +++ b/src/pester-tests/Test-Get-Location.Tests.ps1 @@ -1,6 +1,6 @@ -$here = Split-Path -Parent $MyInvocation.MyCommand.Path -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -. "$here/$sut" + + + Describe "Test-Get-Location aka pwd" { <#Dependencies: diff --git a/src/pester-tests/Test-Get-Member.Tests.ps1 b/src/pester-tests/Test-Get-Member.Tests.ps1 index eb976137bd..7c748197b5 100644 --- a/src/pester-tests/Test-Get-Member.Tests.ps1 +++ b/src/pester-tests/Test-Get-Member.Tests.ps1 @@ -1,6 +1,6 @@ -$here = Split-Path -Parent $MyInvocation.MyCommand.Path -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -. "$here/$sut" + + + Describe "Test-Get-Member" { It "Should be able to be called on string objects, ints, arrays, etc" { diff --git a/src/pester-tests/Test-New-Object.Tests.ps1 b/src/pester-tests/Test-New-Object.Tests.ps1 index 4e4d2cba0a..faaf751331 100644 --- a/src/pester-tests/Test-New-Object.Tests.ps1 +++ b/src/pester-tests/Test-New-Object.Tests.ps1 @@ -1,6 +1,6 @@ -$here = Split-Path -Parent $MyInvocation.MyCommand.Path -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -. "$here/$sut" + + + Describe "New-Object" { It "should create an object with 4 fields" { diff --git a/src/pester-tests/Test-Split-Path.Tests.ps1 b/src/pester-tests/Test-Split-Path.Tests.ps1 index e9f154c8ef..8487a3f6f6 100644 --- a/src/pester-tests/Test-Split-Path.Tests.ps1 +++ b/src/pester-tests/Test-Split-Path.Tests.ps1 @@ -1,6 +1,6 @@ -$here = Split-Path -Parent $MyInvocation.MyCommand.Path -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -. "$here/$sut" + + + Describe "Test-Split-Path" { <#