From 1d883c705d89d7de053328c036a53e1ded5320a9 Mon Sep 17 00:00:00 2001 From: Bryce Milton Date: Thu, 21 Apr 2016 13:00:57 -0700 Subject: [PATCH] attempting to work around Linux\OS1 dynamic file https://github.com/PowerShell/PowerShell/issues/891 --- test/powershell/Add-Content.Tests.ps1 | 12 ++++++------ test/powershell/Set-Content.Tests.ps1 | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/test/powershell/Add-Content.Tests.ps1 b/test/powershell/Add-Content.Tests.ps1 index 8f0312351a..8b70517e6b 100644 --- a/test/powershell/Add-Content.Tests.ps1 +++ b/test/powershell/Add-Content.Tests.ps1 @@ -11,11 +11,11 @@ Describe "Add-Content cmdlet tests" { $result = get-content -path testdrive:\$file1 $result | Should BeExactly "ExpectedContent" } - It "should Add-Content to testdrive:\dynamicfile.txt with dynamic parameters" -Pending:($IsLinux -Or $IsOSX) {#https://github.com/PowerShell/PowerShell/issues/891 - $result=add-content -path testdrive:\dynamicfile.txt -value "ExpectedContent" -passthru + It "should Add-Content to testdrive:\dynamicfile.txt with dynamic parameters" { + $result=add-content -path (Join-Path testdrive: -ChildPath dynamicfile.txt) -value "ExpectedContent" -passthru $result| Should BeExactly "ExpectedContent" } - It "should return expected string from testdrive:\dynamicfile.txt" -Pending:($IsLinux -Or $IsOSX) {#https://github.com/PowerShell/PowerShell/issues/891 + It "should return expected string from testdrive:\dynamicfile.txt" { $result = get-content -path testdrive:\dynamicfile.txt $result | Should BeExactly "ExpectedContent" } @@ -35,10 +35,10 @@ Describe "Add-Content cmdlet tests" { #[DRT][BugId(BugDatabase.WindowsOutOfBandReleases, 906022)] {add-content -path HKLM:\\software\\microsoft -value "ShouldNotWorkBecausePathIsUnsupported" -ea stop} | Should Throw "IContentCmdletProvider interface is not implemented" } - It "should be able to pass multiple [string]`$objects to Add-Content through the pipeline to output a dynamic Path file" -Pending:($IsLinux -Or $IsOSX) {#https://github.com/PowerShell/PowerShell/issues/891 + It "should be able to pass multiple [string]`$objects to Add-Content through the pipeline to output a dynamic Path file" { #[DRT][BugId(BugDatabase.WindowsOutOfBandReleases, 9058182)] - "hello","world"|add-content testdrive:\dynamicfile2.txt - $result=get-content testdrive:\dynamicfile2.txt + "hello","world"|add-content -path (Join-Path testdrive: -ChildPath dynamicfile2.txt) + $result=get-content -path testdrive:\dynamicfile2.txt $result.length |Should be 2 $result[0] |Should be "hello" $result[1] |Should be "world" diff --git a/test/powershell/Set-Content.Tests.ps1 b/test/powershell/Set-Content.Tests.ps1 index 5a0feebbc7..7fcbe2f6e9 100644 --- a/test/powershell/Set-Content.Tests.ps1 +++ b/test/powershell/Set-Content.Tests.ps1 @@ -11,11 +11,11 @@ Describe "Set-Content cmdlet tests" { $result = get-content -path testdrive:\$file1 $result | Should BeExactly "ExpectedContent" } - It "should Set-Content to testdrive:\dynamicfile.txt with dynamic parameters" -Pending:($IsLinux -Or $IsOSX) {#https://github.com/PowerShell/PowerShell/issues/891 - $result=set-content -path testdrive:\dynamicfile.txt -value "ExpectedContent" -passthru + It "should Set-Content to testdrive:\dynamicfile.txt with dynamic parameters" { + $result=set-content -path (Join-Path testdrive: -ChildPath dynamicfile.txt) -value "ExpectedContent" -passthru $result| Should BeExactly "ExpectedContent" } - It "should return expected string from testdrive:\dynamicfile.txt" -Pending:($IsLinux -Or $IsOSX) {#https://github.com/PowerShell/PowerShell/issues/891 + It "should return expected string from testdrive:\dynamicfile.txt" { $result = get-content -path testdrive:\dynamicfile.txt $result | Should BeExactly "ExpectedContent" } @@ -38,10 +38,10 @@ Describe "Set-Content cmdlet tests" { #[DRT][BugId(BugDatabase.WindowsOutOfBandReleases, 906022)] {set-content -path HKLM:\\software\\microsoft -value "ShouldNotWorkBecausePathIsUnsupported" -ea stop} | Should Throw "IContentCmdletProvider interface is not implemented" } - It "should be able to pass multiple [string]`$objects to Set-Content through the pipeline to output a dynamic Path file" -Pending:($IsLinux -Or $IsOSX) {#https://github.com/PowerShell/PowerShell/issues/891 + It "should be able to pass multiple [string]`$objects to Set-Content through the pipeline to output a dynamic Path file" { #[DRT][BugId(BugDatabase.WindowsOutOfBandReleases, 9058182)] - "hello","world"|set-content testdrive:\dynamicfile2.txt - $result=get-content testdrive:\dynamicfile2.txt + "hello","world"|set-content (Join-Path testdrive: -ChildPath dynamicfile2.txt) + $result=get-content -path testdrive:\dynamicfile2.txt $result.length |Should be 2 $result[0] |Should be "hello" $result[1] |Should be "world"