Skip to content

Commit

Permalink
more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
potatoqualitee committed Oct 21, 2024
1 parent 9bebdac commit 08fcd74
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
14 changes: 7 additions & 7 deletions tests/Export-DbaDbRole.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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];"
}
}
}
16 changes: 8 additions & 8 deletions tests/Export-DbaServerRole.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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];"
}
}
}
2 changes: 1 addition & 1 deletion tests/Get-DbaExternalProcess.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down
2 changes: 1 addition & 1 deletion tests/Stop-DbaExternalProcess.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down

0 comments on commit 08fcd74

Please sign in to comment.