diff --git a/src/pester-tests/Test-Add-Member.Tests.ps1 b/src/pester-tests/Test-Add-Member.Tests.ps1 index c3b329896a..4d745500ee 100644 --- a/src/pester-tests/Test-Add-Member.Tests.ps1 +++ b/src/pester-tests/Test-Add-Member.Tests.ps1 @@ -1,5 +1,5 @@ Describe "test-Add-Member" { - + It "should be able to see a newly added member of an object" { $o = New-Object psobject Add-Member -InputObject $o -MemberType NoteProperty -Name proppy -Value "superVal" diff --git a/src/pester-tests/Test-Environment-Variables.Tests.ps1 b/src/pester-tests/Test-Environment-Variables.Tests.ps1 index 9258252eab..6bde8f2898 100644 --- a/src/pester-tests/Test-Environment-Variables.Tests.ps1 +++ b/src/pester-tests/Test-Environment-Variables.Tests.ps1 @@ -5,11 +5,11 @@ It "Should be able to access the members of the environment variable in two ways" { (Get-Item ENV:HOME).Value | Should be "/root" - (Get-Item ENV:HOSTNAME).Value | Should Not BeNullOrEmpty - (Get-Item ENV:PATH).Value | Should Not BeNullOrEmpty + (Get-Item ENV:HOSTNAME).Value | Should Not BeNullOrEmpty + (Get-Item ENV:PATH).Value | Should Not BeNullOrEmpty (ls ENV:HOME).Value | Should be "/root" - (ls ENV:HOSTNAME).Value | Should Not BeNullOrEmpty - (ls ENV:PATH).Value | Should Not BeNullOrEmpty + (ls ENV:HOSTNAME).Value | Should Not BeNullOrEmpty + (ls ENV:PATH).Value | Should Not BeNullOrEmpty } } diff --git a/src/pester-tests/Test-Get-Alias.Tests.ps1 b/src/pester-tests/Test-Get-Alias.Tests.ps1 index ce998c002f..3c51fef2f3 100644 --- a/src/pester-tests/Test-Get-Alias.Tests.ps1 +++ b/src/pester-tests/Test-Get-Alias.Tests.ps1 @@ -1,37 +1,39 @@ 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* + $val = Get-Alias a* + $alias = gal a* $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 b67362fe92..5fba368bfa 100644 --- a/src/pester-tests/Test-Get-ChildItem.Tests.ps1 +++ b/src/pester-tests/Test-Get-ChildItem.Tests.ps1 @@ -1,8 +1,4 @@ - - - - -Describe "Test-Get-ChildItem" { +Describe "Test-Get-ChildItem" { It "Should list the contents of the current folder" { (Get-ChildItem .).Name.Length | Should BeGreaterThan 0 diff --git a/src/pester-tests/Test-Get-Dates.Tests.ps1 b/src/pester-tests/Test-Get-Dates.Tests.ps1 index 4516b72409..e5b67bf9f9 100644 --- a/src/pester-tests/Test-Get-Dates.Tests.ps1 +++ b/src/pester-tests/Test-Get-Dates.Tests.ps1 @@ -1,8 +1,4 @@ - - - - -Describe "Test-Get-Date" { +Describe "Test-Get-Date" { <# 1. foreach 2. diff --git a/src/pester-tests/Test-Get-Item.Tests.ps1 b/src/pester-tests/Test-Get-Item.Tests.ps1 index a66631107a..9399ccaad6 100644 --- a/src/pester-tests/Test-Get-Item.Tests.ps1 +++ b/src/pester-tests/Test-Get-Item.Tests.ps1 @@ -1,8 +1,4 @@ - - - - -Describe "Test-Get-Item" { +Describe "Test-Get-Item" { It "Should list all the items in the current working directory when asterisk is used" { (Get-Item *).GetType().BaseType | Should Be 'array' (Get-Item *).GetType().Name | Should Be 'Object[]' diff --git a/src/pester-tests/Test-Get-Location.Tests.ps1 b/src/pester-tests/Test-Get-Location.Tests.ps1 index 2032dd8c25..287dbc6323 100644 --- a/src/pester-tests/Test-Get-Location.Tests.ps1 +++ b/src/pester-tests/Test-Get-Location.Tests.ps1 @@ -1,8 +1,4 @@ - - - - -Describe "Test-Get-Location aka pwd" { +Describe "Test-Get-Location aka pwd" { <#Dependencies: pushd popd @@ -26,4 +22,4 @@ Describe "Test-Get-Location aka pwd" { (pwd).Path | Should Not BeNullOrEmpty (pwd).Path | Should Be ($winHome -or $nixHome) } -} +} diff --git a/src/pester-tests/Test-Get-Member.Tests.ps1 b/src/pester-tests/Test-Get-Member.Tests.ps1 index 7c748197b5..a4d5303ead 100644 --- a/src/pester-tests/Test-Get-Member.Tests.ps1 +++ b/src/pester-tests/Test-Get-Member.Tests.ps1 @@ -1,8 +1,4 @@ - - - - -Describe "Test-Get-Member" { +Describe "Test-Get-Member" { It "Should be able to be called on string objects, ints, arrays, etc" { $a = 1 #test numbers $b = 1.3 @@ -10,7 +6,7 @@ Describe "Test-Get-Member" { $d = @(1,3) # test arrays $e = "anoeduntodeu" #test strings $f = 'asntoheusth' #test strings - + Get-Member -InputObject $a | Should Not BeNullOrEmpty Get-Member -InputObject $b | Should Not BeNullOrEmpty Get-Member -InputObject $c | Should Not BeNullOrEmpty @@ -42,4 +38,4 @@ Describe "Test-Get-Member" { Get-Member -InputObject $o | Should Not BeNullOrEmpty } -} +} diff --git a/src/pester-tests/Test-Get-PSDrive.Tests.ps1 b/src/pester-tests/Test-Get-PSDrive.Tests.ps1 index df61c8825f..3927c9ad44 100644 --- a/src/pester-tests/Test-Get-PSDrive.Tests.ps1 +++ b/src/pester-tests/Test-Get-PSDrive.Tests.ps1 @@ -1,22 +1,21 @@ - -Describe "Test-Get-PSDrive" { +Describe "Test-Get-PSDrive" { It "Should not throw" { - Get-PSDrive | Should Not BeNullOrEmpty - (Get-PSDrive).Name | Should Not BeNullOrEmpty + Get-PSDrive | Should Not BeNullOrEmpty + (Get-PSDrive).Name | Should Not BeNullOrEmpty (Get-PSDrive).Root.Length | Should Not BeLessThan 1 - gdr | Should Not BeNullOrEmpty - (gdr).Name | Should Not BeNullOrEmpty + gdr | Should Not BeNullOrEmpty + (gdr).Name | Should Not BeNullOrEmpty (gdr).Root.Length | Should Not BeLessThan 1 } It "Should return drive info"{ - (Get-PSDrive Env).Name | Should Be Env - (Get-PSDrive /).Root | Should Be / + (Get-PSDrive Env).Name | Should Be Env + (Get-PSDrive /).Root | Should Be / (Get-PSDrive /).Provider.Name | Should Be FileSystem - (gdr Env).Name | Should Be Env - (gdr /).Root | Should Be / + (gdr Env).Name | Should Be Env + (gdr /).Root | Should Be / (gdr /).Provider.Name | Should Be FileSystem } diff --git a/src/pester-tests/Test-New-Object.Tests.ps1 b/src/pester-tests/Test-New-Object.Tests.ps1 index faaf751331..a2bfaa14cc 100644 --- a/src/pester-tests/Test-New-Object.Tests.ps1 +++ b/src/pester-tests/Test-New-Object.Tests.ps1 @@ -1,20 +1,16 @@ - - - - -Describe "New-Object" { +Describe "New-Object" { It "should create an object with 4 fields" { $o = New-Object psobject $val = $o.GetType() - $val.IsPublic | Should Not BeNullOrEmpty - $val.Name | Should Not BeNullOrEmpty + $val.IsPublic | Should Not BeNullOrEmpty + $val.Name | Should Not BeNullOrEmpty $val.IsSerializable | Should Not BeNullOrEmpty - $val.BaseType | Should Not BeNullOrEmpty + $val.BaseType | Should Not BeNullOrEmpty - $val.IsPublic | Should Be $true + $val.IsPublic | Should Be $true $val.IsSerializable | Should Be $false - $val.Name | Should Be 'PSCustomObject' - $val.BaseType | Should Be 'System.Object' + $val.Name | Should Be 'PSCustomObject' + $val.BaseType | Should Be 'System.Object' } -} +} diff --git a/src/pester-tests/Test-PSVersionTable.Tests.ps1 b/src/pester-tests/Test-PSVersionTable.Tests.ps1 index a9dd3977a9..d7abb2c039 100644 --- a/src/pester-tests/Test-PSVersionTable.Tests.ps1 +++ b/src/pester-tests/Test-PSVersionTable.Tests.ps1 @@ -5,12 +5,12 @@ It "Should have the right version table entries" { - $PSVersionTable.ContainsKey("PSVersion") | Should Be True - $PSVersionTable.ContainsKey("WSManStackVersion") | Should Be True - $PSVersionTable.ContainsKey("SerializationVersion") | Should Be True - $PSVersionTable.ContainsKey("CLRVersion") | Should Be True - $PSVersionTable.ContainsKey("BuildVersion") | Should Be True - $PSVersionTable.ContainsKey("PSCompatibleVersions") | Should Be True + $PSVersionTable.ContainsKey("PSVersion") | Should Be True + $PSVersionTable.ContainsKey("WSManStackVersion") | Should Be True + $PSVersionTable.ContainsKey("SerializationVersion") | Should Be True + $PSVersionTable.ContainsKey("CLRVersion") | Should Be True + $PSVersionTable.ContainsKey("BuildVersion") | Should Be True + $PSVersionTable.ContainsKey("PSCompatibleVersions") | Should Be True $PSVersionTable.ContainsKey("PSRemotingProtocolVersion") | Should Be True } diff --git a/src/pester-tests/Test-Split-Path.Tests.ps1 b/src/pester-tests/Test-Split-Path.Tests.ps1 index 8487a3f6f6..c599b2382d 100644 --- a/src/pester-tests/Test-Split-Path.Tests.ps1 +++ b/src/pester-tests/Test-Split-Path.Tests.ps1 @@ -1,8 +1,4 @@ - - - - -Describe "Test-Split-Path" { +Describe "Test-Split-Path" { <# Dependencies: 1. Split-Path - FUT @@ -12,8 +8,8 @@ Describe "Test-Split-Path" { #> It "Should return a string object when invoked" { - (Split-Path .).GetType().Name |Should Be "String" - (Split-Path . -Leaf).GetType().Name | Should Be "String" + (Split-Path .).GetType().Name | Should Be "String" + (Split-Path . -Leaf).GetType().Name | Should Be "String" (Split-Path . -Resolve).GetType().Name | Should Be "String" } @@ -30,8 +26,8 @@ Describe "Test-Split-Path" { } It "Should be able to tell if a given path is an absolute path" { - (Split-Path /usr/bin -IsAbsolute) |Should be $true - (Split-Path . -IsAbsolute) | Should be $false + (Split-Path /usr/bin -IsAbsolute) | Should be $true + (Split-Path . -IsAbsolute) | Should be $false } It "Should support piping" {