@@ -192,7 +192,7 @@ Describe "Add-DBOBuild tests" -Tag $commandName, UnitTests {
192
192
$testResults.Name | Should Be (Split-Path $packageNameTest - Leaf)
193
193
Test-Path $packageNameTest | Should Be $true
194
194
$scripts = $testResults.GetBuild (' 2.0' ).Scripts
195
- Join-PSFPath - Normalize ' content\2.0' ((Resolve-Path $v2scripts - Relative) -replace ' ^\.\\|^\.\/' , ' ' )| Should BeIn $scripts.GetPackagePath ()
195
+ Join-PSFPath - Normalize ' content\2.0' ((Resolve-Path $v2scripts - Relative) -replace ' ^\.\\|^\.\/' , ' ' ) | Should BeIn $scripts.GetPackagePath ()
196
196
Join-PSFPath - Normalize ' content\2.0\1.sql' | Should Not BeIn $scripts.GetPackagePath ()
197
197
$items = Get-ArchiveItem $packageNameTest
198
198
Join-PSFPath - Normalize ' content\1.0\1.sql' | Should BeIn $items.Path
@@ -204,7 +204,7 @@ Describe "Add-DBOBuild tests" -Tag $commandName, UnitTests {
204
204
$testResults.Name | Should Be (Split-Path $packageNameTest - Leaf)
205
205
Test-Path $packageNameTest | Should Be $true
206
206
$scripts = $testResults.GetBuild (' 2.0' ).Scripts
207
- Join-PSFPath - Normalize ' content\2.0' ($v2scripts -replace ' :' , ' ' )| Should BeIn $scripts.GetPackagePath ()
207
+ Join-PSFPath - Normalize ' content\2.0' ($v2scripts -replace ' :' , ' ' ) | Should BeIn $scripts.GetPackagePath ()
208
208
Join-PSFPath - Normalize ' content\2.0\1.sql' | Should Not BeIn $scripts.GetPackagePath ()
209
209
$items = Get-ArchiveItem $packageNameTest
210
210
Join-PSFPath - Normalize ' content\1.0\1.sql' | Should BeIn $items.Path
@@ -242,6 +242,22 @@ Describe "Add-DBOBuild tests" -Tag $commandName, UnitTests {
242
242
Join-PSFPath - Normalize ' content\2.0\2.sql' | Should BeIn $items.Path
243
243
Join-PSFPath - Normalize ' content\2.0\3.sql' | Should Not BeIn $items.Path
244
244
}
245
+ It " Should add only matched files from a recursive folder" {
246
+ $testResults = Add-DBOBuild - ScriptPath $noRecurseFolder \* - Name $packageNameTest - Build 2.0 -Match ' 2\.sql'
247
+ $testResults | Should Not Be $null
248
+ $testResults.Name | Should Be (Split-Path $packageNameTest - Leaf)
249
+ Test-Path $packageNameTest | Should Be $true
250
+ $scripts = $testResults.GetBuild (' 2.0' ).Scripts
251
+ $scripts | Should -Not - BeNullOrEmpty
252
+ Join-PSFPath - Normalize ' content\2.0\success\1.sql' | Should Not BeIn $scripts.GetPackagePath ()
253
+ Join-PSFPath - Normalize ' content\2.0\success\2.sql' | Should BeIn $scripts.GetPackagePath ()
254
+ Join-PSFPath - Normalize ' content\2.0\success\3.sql' | Should Not BeIn $scripts.GetPackagePath ()
255
+ $items = Get-ArchiveItem $packageNameTest
256
+ Join-PSFPath - Normalize ' content\1.0\1.sql' | Should BeIn $items.Path
257
+ Join-PSFPath - Normalize ' content\2.0\success\1.sql' | Should Not BeIn $items.Path
258
+ Join-PSFPath - Normalize ' content\2.0\success\2.sql' | Should BeIn $items.Path
259
+ Join-PSFPath - Normalize ' content\2.0\success\3.sql' | Should Not BeIn $items.Path
260
+ }
245
261
}
246
262
Context " negative tests" {
247
263
BeforeAll {
@@ -267,7 +283,7 @@ Describe "Add-DBOBuild tests" -Tag $commandName, UnitTests {
267
283
$errorResult.Exception.Message -join ' ;' | Should BeLike ' *Incorrect package format*'
268
284
}
269
285
It " should throw error when package zip does not exist" {
270
- { Add-DBOBuild - Name " .\nonexistingpackage.zip" - ScriptPath $v1scripts - ErrorAction Stop} | Should Throw
286
+ { Add-DBOBuild - Name " .\nonexistingpackage.zip" - ScriptPath $v1scripts - ErrorAction Stop } | Should Throw
271
287
}
272
288
It " should throw error when path cannot be resolved" {
273
289
try {
0 commit comments