-
-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
292 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,58 @@ | ||
. (Join-Path -Path $PSScriptRoot -ChildPath '_envPrep.ps1') | ||
BeforeAll { | ||
if (Get-Module -Name 'BurntToast') { | ||
Remove-Module -Name 'BurntToast' | ||
} | ||
|
||
if ($ENV:BURNTTOAST_MODULE_ROOT) { | ||
Import-Module $ENV:BURNTTOAST_MODULE_ROOT -Force | ||
} else { | ||
Import-Module "$PSScriptRoot/../src/BurntToast.psd1" -Force | ||
} | ||
} | ||
|
||
Describe 'BurntToast Module' { | ||
Context 'meta validation' { | ||
It 'should import functions' { | ||
(Get-Module BurntToast).ExportedFunctions.Count | Should -Be 25 | ||
(Get-Module BurntToast).ExportedFunctions.Count | Should -Be 21 | ||
} | ||
|
||
It 'should import aliases' { | ||
(Get-Module BurntToast).ExportedAliases.Count | Should -Be 1 | ||
} | ||
} | ||
|
||
Context 'Importing on Unsupported Operating Systems' { | ||
It 'throws when importing on operating systems older than Windows 10' { | ||
$env:BurntToastPesterNotWindows10 = $true | ||
|
||
if (Get-Module -Name 'BurntToast') { | ||
Remove-Module -Name 'BurntToast' | ||
} | ||
|
||
if ($ENV:BURNTTOAST_MODULE_ROOT) { | ||
{Import-Module $ENV:BURNTTOAST_MODULE_ROOT -Force} | Should -Throw -ExpectedMessage 'This version of BurntToast will only work on Windows 10*' | ||
} else { | ||
{Import-Module "$PSScriptRoot/../src/BurntToast.psd1" -Force} | Should -Throw -ExpectedMessage 'This version of BurntToast will only work on Windows 10*' | ||
} | ||
} | ||
|
||
It 'throws when importing on Windows 10 builds older than the Anniversary Update' { | ||
$env:BurntToastPesterNotAnniversaryUpdate = $true | ||
|
||
if (Get-Module -Name 'BurntToast') { | ||
Remove-Module -Name 'BurntToast' | ||
} | ||
|
||
if ($ENV:BURNTTOAST_MODULE_ROOT) { | ||
{Import-Module $ENV:BURNTTOAST_MODULE_ROOT -Force} | Should -Throw -ExpectedMessage 'This version of BurntToast will only work on Windows 10 Creators Update (15063) and above*' | ||
} else { | ||
{Import-Module "$PSScriptRoot/../src/BurntToast.psd1" -Force} | Should -Throw -ExpectedMessage 'This version of BurntToast will only work on Windows 10 Creators Update (15063) and above*' | ||
} | ||
} | ||
|
||
AfterEach { | ||
$env:BurntToastPesterNotWindows10 = $null | ||
$env:BurntToastPesterNotAnniversaryUpdate = $null | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.