From 4feb6652031ab075a23e4a9e674b2e57541f7825 Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Fri, 4 Mar 2016 14:40:33 -0800 Subject: [PATCH] Update PSVersionTable tests for PSEdition --- test/powershell/PSVersionTable.Tests.ps1 | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/test/powershell/PSVersionTable.Tests.ps1 b/test/powershell/PSVersionTable.Tests.ps1 index e7d9f92160..3487ccb3e2 100644 --- a/test/powershell/PSVersionTable.Tests.ps1 +++ b/test/powershell/PSVersionTable.Tests.ps1 @@ -1,11 +1,11 @@ Describe "PSVersionTable" { It "Should have version table entries" { - $PSVersionTable.Count | Should BeGreaterThan 6 + $PSVersionTable.Count | Should Be 8 } It "Should have the right version table entries" { - $PSVersionTable.ContainsKey("PSVersion") | Should Be True + $PSVersionTable.ContainsKey("PSEdition") | Should Be True $PSVersionTable.ContainsKey("WSManStackVersion") | Should Be True $PSVersionTable.ContainsKey("SerializationVersion") | Should Be True $PSVersionTable.ContainsKey("CLRVersion") | Should Be True @@ -14,4 +14,17 @@ $PSVersionTable.ContainsKey("PSRemotingProtocolVersion") | Should Be True } + + It "Should have the correct edition" -Skip:(!$IsCore) { + $expected = + if ($IsLinux -Or $IsOSX) { + "Linux" + } elseif ($IsWindows) { + "Core" + } else { + throw [PlatformNotSupportedException] + } + + $PSVersionTable["PSEdition"] | Should Be $expected + } }