Skip to content

Commit

Permalink
Merge pull request majkinetor#103 from Thilas/add-description-test
Browse files Browse the repository at this point in the history
Add test for stream specific descriptions
  • Loading branch information
majkinetor authored Oct 31, 2017
2 parents 087d8d4 + 5cb87c3 commit d786ac9
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/Update-Package.Streams.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,21 @@ Describe 'Update-Package using streams' -Tag updatestreams {
(nuspec_file).package.metadata.description.InnerText.Trim() | Should Be $readme
}

It 'can set stream specific descriptions from README.md' {
get_latest -Version 1.4.0

$readme = 'dummy readme & test: '
function au_BeforeUpdate { param([AUPackage] $package)
'','', ($readme + $package.RemoteVersion) | Out-File $TestDrive\test_package_with_streams\README.md
}
function au_AfterUpdate { param([AUPackage] $package)
$package.NuspecXml.package.metadata.description.InnerText.Trim() | Should Be ($readme + $package.RemoteVersion)
}

$res = update
$res.Result -match 'Setting package description from README.md' | Should Be $true
}

It 'does not set description from README.md with NoReadme parameter' {
$readme = 'dummy readme & test'
'','', $readme | Out-File $TestDrive\test_package_with_streams\README.md
Expand Down

0 comments on commit d786ac9

Please sign in to comment.