From 08fcd748522c5b9db88b021736507310d7771cdf Mon Sep 17 00:00:00 2001 From: Chrissy LeMaire Date: Mon, 21 Oct 2024 06:54:48 +0200 Subject: [PATCH] more fixes --- tests/Export-DbaDbRole.Tests.ps1 | 14 +++++++------- tests/Export-DbaServerRole.Tests.ps1 | 16 ++++++++-------- tests/Get-DbaExternalProcess.Tests.ps1 | 2 +- tests/Stop-DbaExternalProcess.Tests.ps1 | 2 +- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/tests/Export-DbaDbRole.Tests.ps1 b/tests/Export-DbaDbRole.Tests.ps1 index 7c2f16bb49..e70895f771 100644 --- a/tests/Export-DbaDbRole.Tests.ps1 +++ b/tests/Export-DbaDbRole.Tests.ps1 @@ -65,24 +65,24 @@ Describe "$commandname Integration Tests" -Tags "IntegrationTests" { (Get-ChildItem $outputFile1).Length | Should BeGreaterThan 0 } - $TestConfig.results = $role | Export-DbaDbRole -Passthru + $script:results = $role | Export-DbaDbRole -Passthru It "should include the defined BatchSeparator" { - $TestConfig.results -match "GO" + $script:results -match "GO" } It "should include the role" { - $TestConfig.results -match "CREATE ROLE [$dbRole]" + $script:results -match "CREATE ROLE [$dbRole]" } It "should include GRANT EXECUTE ON SCHEMA" { - $TestConfig.results -match "GRANT EXECUTE ON SCHEMA::[dbo] TO [$dbRole];" + $script:results -match "GRANT EXECUTE ON SCHEMA::[dbo] TO [$dbRole];" } It "should include GRANT SELECT ON SCHEMA" { - $TestConfig.results -match "GRANT SELECT ON SCHEMA::[dbo] TO [$dbRole];" + $script:results -match "GRANT SELECT ON SCHEMA::[dbo] TO [$dbRole];" } It "should include GRANT VIEW DEFINITION ON SCHEMA" { - $TestConfig.results -match "GRANT VIEW DEFINITION ON SCHEMA::[dbo] TO [$dbRole];" + $script:results -match "GRANT VIEW DEFINITION ON SCHEMA::[dbo] TO [$dbRole];" } It "should include ALTER ROLE ADD MEMBER" { - $TestConfig.results -match "ALTER ROLE [$dbRole] ADD MEMBER [$user1];" + $script:results -match "ALTER ROLE [$dbRole] ADD MEMBER [$user1];" } } } diff --git a/tests/Export-DbaServerRole.Tests.ps1 b/tests/Export-DbaServerRole.Tests.ps1 index af59bf59ae..174001f17c 100644 --- a/tests/Export-DbaServerRole.Tests.ps1 +++ b/tests/Export-DbaServerRole.Tests.ps1 @@ -62,27 +62,27 @@ Describe "$commandname Integration Tests" -Tags "IntegrationTests" { (Get-ChildItem $outputFile).Length | Should BeGreaterThan 0 } - $TestConfig.results = $role | Export-DbaServerRole -Passthru + $script:results = $role | Export-DbaServerRole -Passthru It "should include the defined BatchSeparator" { - $TestConfig.results -match "GO" + $script:results -match "GO" } It "should include the role" { - $TestConfig.results -match "CREATE SERVER ROLE [$svRole]" + $script:results -match "CREATE SERVER ROLE [$svRole]" } It "should include ADD MEMBER" { - $TestConfig.results -match "ALTER SERVER ROLE [dbcreator] ADD MEMBER [$svRole]" + $script:results -match "ALTER SERVER ROLE [dbcreator] ADD MEMBER [$svRole]" } It "should include GRANT CREATE TRACE EVENT" { - $TestConfig.results -match "GRANT CREATE TRACE EVENT NOTIFICATION TO [$svRole]" + $script:results -match "GRANT CREATE TRACE EVENT NOTIFICATION TO [$svRole]" } It "should include DENY SELECT ALL USER SECURABLES" { - $TestConfig.results -match "DENY SELECT ALL USER SECURABLES TO [$svRole]" + $script:results -match "DENY SELECT ALL USER SECURABLES TO [$svRole]" } It "should include VIEW ANY DEFINITION" { - $TestConfig.results -match "GRANT VIEW ANY DEFINITION TO [$svRole];" + $script:results -match "GRANT VIEW ANY DEFINITION TO [$svRole];" } It "should include GRANT VIEW ANY DATABASE" { - $TestConfig.results -match "GRANT VIEW ANY DATABASE TO [$svRole];" + $script:results -match "GRANT VIEW ANY DATABASE TO [$svRole];" } } } diff --git a/tests/Get-DbaExternalProcess.Tests.ps1 b/tests/Get-DbaExternalProcess.Tests.ps1 index 98afa608b6..b67ee7c911 100644 --- a/tests/Get-DbaExternalProcess.Tests.ps1 +++ b/tests/Get-DbaExternalProcess.Tests.ps1 @@ -32,7 +32,7 @@ Describe "$CommandName Integration Tests" -Tags "IntegrationTests" { $query = @" xp_cmdshell 'powershell -command ""sleep 20""' "@ - Start-Process -FilePath sqlcmd -ArgumentList "-S $TestConfig.instance1 -Q `"$query`"" -NoNewWindow -RedirectStandardOutput null + Start-Process -FilePath sqlcmd -ArgumentList "-S $($TestConfig.instance1) -Q `"$query`"" -NoNewWindow -RedirectStandardOutput null } It "returns a process" { diff --git a/tests/Stop-DbaExternalProcess.Tests.ps1 b/tests/Stop-DbaExternalProcess.Tests.ps1 index 3c2164301e..e729a88aef 100644 --- a/tests/Stop-DbaExternalProcess.Tests.ps1 +++ b/tests/Stop-DbaExternalProcess.Tests.ps1 @@ -33,7 +33,7 @@ Describe "$CommandName Integration Tests" -Tags "IntegrationTests" { $query = @" xp_cmdshell 'powershell -command ""sleep 20""' "@ - Start-Process -FilePath sqlcmd -ArgumentList "-S $TestConfig.instance1 -Q `"$query`"" -NoNewWindow -RedirectStandardOutput null + Start-Process -FilePath sqlcmd -ArgumentList "-S $($TestConfig.instance1) -Q `"$query`"" -NoNewWindow -RedirectStandardOutput null } It "returns results" {