|
1 | 1 | #region HEADER |
2 | | -$script:DSCModuleName = 'ComputerManagementDsc' |
3 | | -$script:DSCResourceName = 'MSFT_PowershellExecutionPolicy' |
| 2 | +$script:DSCModuleName = 'ComputerManagementDsc' |
| 3 | +$script:DSCResourceName = 'MSFT_PowershellExecutionPolicy' |
4 | 4 |
|
5 | 5 | Import-Module -Name (Join-Path -Path (Join-Path -Path (Split-Path $PSScriptRoot -Parent) -ChildPath 'TestHelpers') -ChildPath 'CommonTestHelper.psm1') -Global |
6 | 6 |
|
7 | 7 | # Unit Test Template Version: 1.2.0 |
8 | 8 | $script:moduleRoot = Join-Path -Path $(Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $Script:MyInvocation.MyCommand.Path))) -ChildPath 'Modules\ComputerManagementDsc' |
9 | 9 | if ( (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests'))) -or ` |
10 | | - (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1'))) ) |
| 10 | + (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1'))) ) |
11 | 11 | { |
12 | | - & git @('clone','https://github.com/PowerShell/DscResource.Tests.git',(Join-Path -Path $script:moduleRoot -ChildPath '\DSCResource.Tests\')) |
| 12 | + & git @('clone', 'https://github.com/PowerShell/DscResource.Tests.git', (Join-Path -Path $script:moduleRoot -ChildPath '\DSCResource.Tests\')) |
13 | 13 | } |
14 | 14 |
|
15 | 15 | Import-Module -Name (Join-Path -Path $script:moduleRoot -ChildPath (Join-Path -Path 'DSCResource.Tests' -ChildPath 'TestHelper.psm1')) -Force |
|
83 | 83 |
|
84 | 84 | It 'Returns false when current policy does not match desired policy' { |
85 | 85 | Mock -CommandName Get-ExecutionPolicy -MockWith { 'Restricted' } |
86 | | - Test-TargetResource -ExecutionPolicy "Bypass" -ExecutionPolicyScope 'LocalMachine' | Should be $false |
| 86 | + Test-TargetResource -ExecutionPolicy 'Bypass' -ExecutionPolicyScope 'LocalMachine' | Should be $false |
87 | 87 | } |
88 | 88 |
|
89 | 89 | It 'Throws when passed an invalid execution policy Scope' { |
|
118 | 118 | $result | should be $null |
119 | 119 | } |
120 | 120 |
|
121 | | - It 'Throws non-caught exceptions'{ |
| 121 | + It 'Throws non-caught exceptions' { |
122 | 122 | Mock -CommandName Set-ExecutionPolicy -MockWith { Throw 'Throw me!' } |
123 | 123 | { Set-TargetResource -ExecutionPolicy 'Bypass' -ExecutionPolicyScope 'LocalMachine' } | Should -Throw 'Throw me!' |
124 | 124 | } |
|
0 commit comments