Skip to content

Commit

Permalink
variable value not always available in BeforeAll block, moved call f…
Browse files Browse the repository at this point in the history
…or location into Before block to fix error. (#268)
  • Loading branch information
twerthi authored Jan 29, 2021
1 parent 24b448e commit 3f56344
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
$moduleName = Split-Path ($PSCommandPath -replace '\.Tests\.ps1$', '') -Leaf
$script:modulePath = Split-Path $PSCommandPath -Parent
$script:modulePath = Resolve-Path "$PSCommandPath/../../DSCResources/$moduleName/$moduleName.psm1"
$script:dscHelpersPath = Resolve-Path "$PSCommandPath/../../OctopusDSCHelpers.ps1"
$module = $null

try
Expand Down Expand Up @@ -105,6 +104,7 @@ try

Context 'Set-TargetResource' {
BeforeAll {
$dscHelpersPath = Resolve-Path "$PSCommandPath/../../OctopusDSCHelpers.ps1"
. $dscHelpersPath
}
It 'Calls Invoke-OctopusServerCommand with the correct arguments' {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
$moduleName = Split-Path ($PSCommandPath -replace '\.Tests\.ps1$', '') -Leaf
$modulePath = Split-Path $PSCommandPath -Parent
$modulePath = Resolve-Path "$PSCommandPath/../../DSCResources/$moduleName/$moduleName.psm1"
$script:dscHelpersPath = Resolve-Path "$PSCommandPath/../../OctopusDSCHelpers.ps1"
$module = $null

try
Expand Down Expand Up @@ -105,6 +104,7 @@ try

Context 'Set-TargetResource' {
BeforeAll {
$dscHelpersPath = Resolve-Path "$PSCommandPath/../../OctopusDSCHelpers.ps1"
. $dscHelpersPath
}
It 'Calls Invoke-OctopusServerCommand with the correct arguments' {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ try

Context 'Set-TargetResource' {
BeforeAll {
$dscHelpersPath = Resolve-Path "$PSCommandPath/../../OctopusDSCHelpers.ps1"
. $dscHelpersPath
}
It 'Calls Invoke-OctopusServerCommand with the correct arguments' {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
$moduleName = Split-Path ($PSCommandPath -replace '\.Tests\.ps1$', '') -Leaf
$modulePath = Split-Path $PSCommandPath -Parent
$modulePath = Resolve-Path "$PSCommandPath/../../DSCResources/$moduleName/$moduleName.psm1"
$script:dscHelpersPath = Resolve-Path "$PSCommandPath/../../OctopusDSCHelpers.ps1"
$module = $null

try
Expand Down Expand Up @@ -78,6 +77,7 @@ try

Context 'Set-TargetResource' {
BeforeAll {
$dscHelpersPath = Resolve-Path "$PSCommandPath/../../OctopusDSCHelpers.ps1"
. $dscHelpersPath
}
It 'Calls Invoke-OctopusServerCommand with the correct arguments' {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
$moduleName = Split-Path ($PSCommandPath -replace '\.Tests\.ps1$', '') -Leaf
$modulePath = Split-Path $PSCommandPath -Parent
$modulePath = Resolve-Path "$PSCommandPath/../../DSCResources/$moduleName/$moduleName.psm1"
$script:dscHelpersPath = Resolve-Path "$PSCommandPath/../../OctopusDSCHelpers.ps1"
$module = $null

try
Expand Down Expand Up @@ -105,6 +104,7 @@ try

Context 'Set-TargetResource' {
BeforeAll {
$dscHelpersPath = Resolve-Path "$PSCommandPath/../../OctopusDSCHelpers.ps1"
. $dscHelpersPath
}
It 'Calls Invoke-OctopusServerCommand with the correct arguments' {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
$moduleName = Split-Path ($PSCommandPath -replace '\.Tests\.ps1$', '') -Leaf
$modulePath = Split-Path $PSCommandPath -Parent
$modulePath = Resolve-Path "$PSCommandPath/../../DSCResources/$moduleName/$moduleName.psm1"
$script:dscHelpersPath = Resolve-Path "$PSCommandPath/../../OctopusDSCHelpers.ps1"
$module = $null

try
Expand Down Expand Up @@ -78,6 +77,7 @@ try

Context 'Set-TargetResource' {
BeforeAll {
$dscHelpersPath = Resolve-Path "$PSCommandPath/../../OctopusDSCHelpers.ps1"
. $dscHelpersPath
}

Expand Down

0 comments on commit 3f56344

Please sign in to comment.