Skip to content

Commit

Permalink
IsFree test will pass if property missing (catalog defaults to false)
Browse files Browse the repository at this point in the history
  • Loading branch information
shadeon committed Oct 27, 2017
1 parent 487ad36 commit 1f19e71
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Pack.tests.template.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,13 @@ foreach ($packFile in $packFiles) {
}

It "Has IsFree" {
$json.IsFree | Should BeOfType System.Boolean
$IsFree = $json.IsFree

# Treat as false if not specified, as the catalog does
if (($json.PSObject.Properties | Select-Object -ExpandProperty Name) -notcontains 'IsFree') {
$IsFree = $false
}
$IsFree | Should BeOfType System.Boolean
}

It "Has an array of Tags" {
Expand Down

0 comments on commit 1f19e71

Please sign in to comment.