This repository has been archived by the owner on Oct 25, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 71
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 #109 from Thilas/streams-enhancements
Streams enhancements: - Support alphabetical streams (not version-like streams) - Add support for common properties shared between all streams - Add more information on streams for plugins (+ adapt GitReleases) - Rename Include argument into IncludeStream on Update-Package - Add more pester tests (+ enable code coverage)
- Loading branch information
Showing
13 changed files
with
310 additions
and
146 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
remove-module AU -ea ignore | ||
import-module $PSScriptRoot\..\AU | ||
|
||
Describe 'AUPackage' -Tag aupackage { | ||
InModuleScope AU { | ||
It 'throws an error when intanciating without a path' { | ||
{ [AUPackage]::new('') } | Should Throw 'empty' | ||
} | ||
|
||
It 'throws an error when intanciating without a hashtable' { | ||
{ [AUPackage]::new([hashtable] $null) } | Should Throw 'empty' | ||
} | ||
|
||
It 'can serialize and deserialize' { | ||
$expected = @{ | ||
Path = 'path' | ||
Name = 'name' | ||
Updated = $true | ||
Pushed = $true | ||
RemoteVersion = '1.2.3' | ||
NuspecVersion = '0.1.2' | ||
Result = 'result1,result2,result3' -split ',' | ||
Error = 'error' | ||
NuspecPath = 'nuspecPath' | ||
Ignored = $true | ||
IgnoreMessage = 'ignoreMessage' | ||
StreamsPath = 'streamsPath' | ||
Streams = [PSCustomObject] @{ | ||
'0.1' = @{ | ||
NuspecVersion = '0.1.2' | ||
Path = 'path' | ||
Name = 'name' | ||
Updated = $true | ||
RemoteVersion = '1.2.3' | ||
} | ||
'0.2' = @{ | ||
NuspecVersion = '0.2.2' | ||
Path = 'path' | ||
Name = 'name' | ||
Updated = $true | ||
RemoteVersion = '1.2.3' | ||
} | ||
} | ||
} | ||
|
||
$package = [AUPackage]::new($expected) | ||
$actual = $package.Serialize() | ||
|
||
$expected.Keys | ? { $_ -ne 'Streams' } | % { | ||
$actual.$_ | Should Be $expected.$_ | ||
} | ||
$expected.Streams.psobject.Properties | % { | ||
$actual.Streams.$_ | Should Be $expected.Streams.$_ | ||
} | ||
} | ||
} | ||
} |
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.