@@ -16,7 +16,7 @@ Describe "$CommandName Unit Tests" -Tag 'UnitTests' {
16
16
Describe " $commandname Integration Tests" - Tags " IntegrationTests" {
17
17
18
18
Context " Properly restores a database on the local drive using Path" {
19
- $results = Backup-DbaDatabase - SqlInstance $TestConfig.instance1 - BackupDirectory C:\temp\ backups
19
+ $results = Backup-DbaDatabase - SqlInstance $TestConfig.instance1 - BackupDirectory " $ ( $TestConfig .Temp ) \ backups"
20
20
It " Should return a database name, specifically master" {
21
21
($results.DatabaseName -contains ' master' ) | Should - Be $true
22
22
}
@@ -26,7 +26,7 @@ Describe "$commandname Integration Tests" -Tags "IntegrationTests" {
26
26
}
27
27
28
28
BeforeAll {
29
- $DestBackupDir = ' C:\ Temp\backups'
29
+ $DestBackupDir = " $ ( $TestConfig . Temp) \backups"
30
30
$random = Get-Random
31
31
$DestDbRandom = " dbatools_ci_backupdbadatabase$random "
32
32
if (-Not (Test-Path $DestBackupDir )) {
@@ -142,10 +142,10 @@ Describe "$commandname Integration Tests" -Tags "IntegrationTests" {
142
142
143
143
144
144
Context " A fully qualified path should override a backupfolder" {
145
- $results = Backup-DbaDatabase - SqlInstance $TestConfig.instance1 - Database master - BackupDirectory c:\temp - BackupFileName " $DestBackupDir \PesterTest2.bak"
145
+ $results = Backup-DbaDatabase - SqlInstance $TestConfig.instance1 - Database master - BackupDirectory $TestConfig .Temp - BackupFileName " $DestBackupDir \PesterTest2.bak"
146
146
It " Should report backed up to $DestBackupDir " {
147
147
$results.FullName | Should - BeLike " $DestBackupDir \PesterTest2.bak"
148
- $results.BackupFolder | Should Not Be ' c:\temp '
148
+ $results.BackupFolder | Should Not Be $TestConfig .Temp
149
149
}
150
150
It " Should have backuped up to $DestBackupDir \PesterTest2.bak" {
151
151
Test-Path " $DestBackupDir \PesterTest2.bak" | Should - Be $true
0 commit comments