-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from trackd/prerelease
- Loading branch information
Showing
21 changed files
with
789 additions
and
194 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
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
41 changes: 41 additions & 0 deletions
41
PwshSpectreConsole.Tests/formatting/ConvertTo-SpectreDecoration.tests.ps1
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
Remove-Module PwshSpectreConsole -Force -ErrorAction SilentlyContinue | ||
Import-Module "$PSScriptRoot\..\..\PwshSpectreConsole\PwshSpectreConsole.psd1" -Force | ||
Import-Module "$PSScriptRoot\..\TestHelpers.psm1" -Force | ||
|
||
Describe "ConvertTo-SpectreDecoration" { | ||
InModuleScope "PwshSpectreConsole" { | ||
It "Test PSStyle Decorations" { | ||
$PSStyleColor = Get-PSStyleRandom -Decoration | ||
$reset = $PSStyle.Reset | ||
$string = 'Hello, world!, hello universe!' | ||
$sample = "{0}{1}{2}" -f $PSStyleColor, $string, $PSStyle.Reset | ||
$test = Get-SpectreRenderable (ConvertTo-SpectreDecoration $sample) | ||
$test | Should -Be $sample | ||
} | ||
It "Test PSStyle Foreground RGB Colors" -Tag "ExcludeCI" { | ||
# testing something | ||
$PSStyleColor = Get-PSStyleRandom -RGBForeground | ||
$reset = $PSStyle.Reset | ||
$string = 'Hello, world!, hello universe!' | ||
$sample = "{0}{1}{2}" -f $PSStyleColor, $string, $PSStyle.Reset | ||
$test = Get-SpectreRenderable (ConvertTo-SpectreDecoration $sample) | ||
$test | Should -Be $sample | ||
} | ||
It "Test PSStyle Background RGB Colors" -Tag "ExcludeCI" { | ||
$PSStyleColor = Get-PSStyleRandom -RGBBackground | ||
$reset = $PSStyle.Reset | ||
$string = 'Hello, world!, hello universe!' | ||
$sample = "{0}{1}{2}" -f $PSStyleColor, $string, $PSStyle.Reset | ||
$test = Get-SpectreRenderable (ConvertTo-SpectreDecoration $sample) | ||
$test | Should -Be $sample | ||
} | ||
It "Test Spectre Colors" { | ||
# this might work because the colors are generated from CI so shouldnt get us codes we cant render. | ||
$sample = Get-SpectreColorSample | ||
foreach ($item in $sample) { | ||
$test = Get-SpectreRenderable (ConvertTo-SpectreDecoration $item.String) | ||
$test | Should -Be $item.String | ||
} | ||
} | ||
} | ||
} |
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.