refactored Get-Content and Get-Item to compensate for the backslash not being used and the first 3 lines being removed from test suites
This commit is contained in:
parent
c714e7b3ee
commit
5df3094d7b
@ -1,8 +1,4 @@
|
||||
|
||||
|
||||
|
||||
|
||||
Describe "Test-Get-Content" {
|
||||
Describe "Test-Get-Content" {
|
||||
It "Should throw an error on a directory " {
|
||||
# also tests that -erroraction SilentlyContinue will work.
|
||||
|
||||
@ -14,17 +10,17 @@ Describe "Test-Get-Content" {
|
||||
}
|
||||
|
||||
It "Should deliver an array object when listing a file" {
|
||||
(Get-Content -Path .\Test-Get-Content.Tests.ps1).GetType().BaseType.Name | Should Be "Array"
|
||||
(Get-Content -Path .\Test-Get-Content.Tests.ps1)[0] |Should be "`$here = Split-Path -Parent `$MyInvocation.MyCommand.Path"
|
||||
(Get-Content -Path ./Test-Get-Content.Tests.ps1).GetType().BaseType.Name | Should Be "Array"
|
||||
(Get-Content -Path ./Test-Get-Content.Tests.ps1)[0] |Should be "Describe `"Test-Get-Content`" `{"
|
||||
|
||||
(gc -Path .\Test-Get-Content.Tests.ps1).GetType().BaseType.Name | Should Be "Array"
|
||||
(gc -Path .\Test-Get-Content.Tests.ps1)[0] |Should be "`$here = Split-Path -Parent `$MyInvocation.MyCommand.Path"
|
||||
(gc -Path ./Test-Get-Content.Tests.ps1).GetType().BaseType.Name | Should Be "Array"
|
||||
(gc -Path ./Test-Get-Content.Tests.ps1)[0] |Should be "Describe `"Test-Get-Content`" `{"
|
||||
|
||||
(type -Path .\Test-Get-Content.Tests.ps1).GetType().BaseType.Name | Should Be "Array"
|
||||
(type -Path .\Test-Get-Content.Tests.ps1)[0] |Should be "`$here = Split-Path -Parent `$MyInvocation.MyCommand.Path"
|
||||
(type -Path ./Test-Get-Content.Tests.ps1).GetType().BaseType.Name | Should Be "Array"
|
||||
(type -Path ./Test-Get-Content.Tests.ps1)[0] |Should be "Describe `"Test-Get-Content`" `{"
|
||||
|
||||
(cat -Path .\Test-Get-Content.Tests.ps1).GetType().BaseType.Name | Should Be "Array"
|
||||
(cat -Path .\Test-Get-Content.Tests.ps1)[0] |Should be "`$here = Split-Path -Parent `$MyInvocation.MyCommand.Path"
|
||||
(cat -Path ./Test-Get-Content.Tests.ps1).GetType().BaseType.Name | Should Be "Array"
|
||||
(cat -Path ./Test-Get-Content.Tests.ps1)[0] |Should be "Describe `"Test-Get-Content`" `{"
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ Describe "Test-Get-Item" {
|
||||
|
||||
It "Should return the proper Name and BaseType for directory objects vs file system objects" {
|
||||
(Get-Item .).GetType().Name | Should Be 'DirectoryInfo'
|
||||
(Get-Item .\Test-Get-Item.Tests.ps1).GetType().Name | Should Be 'FileInfo'
|
||||
(Get-Item ./Test-Get-Item.Tests.ps1).GetType().Name | Should Be 'FileInfo'
|
||||
}
|
||||
|
||||
It "Should return a different directory when a path argument is used" {
|
||||
|
Loading…
Reference in New Issue
Block a user