Skip to content

Commit 523dcd1

Browse files
committed
Fix some tests and update docs for release
1 parent ebb4c83 commit 523dcd1

3 files changed

Lines changed: 23 additions & 3 deletions

File tree

ReleaseNotes.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# Version 2.1.14
2+
* Improved handling of single quotes in Package function
3+
* Added Functions for
4+
* LocalUser
5+
* AuditPolicy
6+
* Volume
7+
18
# Version 2.1.6
29
* Added Functions for
310
* Firewall

Tests/poshspec.Tests.ps1

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,10 +189,10 @@ Describe 'Test Functions' {
189189
}
190190

191191
It 'Should return a correct text expression' {
192-
$results.Expression | Should Be "Get-Package -Name 'Microsoft Visual Studio Code' -ErrorAction SilentlyContinue | Should Not BeNullOrEmpty"
192+
$results.Expression | Should Be 'Get-Package -Name "Microsoft Visual Studio Code" -ErrorAction SilentlyContinue | Select-Object -First 1 | Should Not BeNullOrEmpty'
193193
}
194194
}
195-
195+
196196
Context 'Package w/ properties' {
197197

198198
$results = Package 'Microsoft Visual Studio Code' version { Should be '1.1.0' }
@@ -202,7 +202,20 @@ Describe 'Test Functions' {
202202
}
203203

204204
It 'Should return a correct text expression' {
205-
$results.Expression | Should Be "Get-Package -Name 'Microsoft Visual Studio Code' -ErrorAction SilentlyContinue | Select-Object -ExpandProperty 'version' | Should be '1.1.0'"
205+
$results.Expression | Should Be "Get-Package -Name ""Microsoft Visual Studio Code"" -ErrorAction SilentlyContinue | Select-Object -First 1 | Select-Object -ExpandProperty 'version' | Should be '1.1.0'"
206+
}
207+
}
208+
209+
Context 'Package w/Single Quotes' {
210+
211+
$results = Package "Name 'subname'" { Should Not BeNullOrEmpty }
212+
213+
It 'Should return a correct test name' {
214+
$results.Name | Should Be "Package 'Name 'subname'' Should Not BeNullOrEmpty"
215+
}
216+
217+
It 'Should return a correct text expression' {
218+
$results.Expression | Should Be "Get-Package -Name ""Name 'subname'"" -ErrorAction SilentlyContinue | Select-Object -First 1 | Should Not BeNullOrEmpty"
206219
}
207220
}
208221

poshspec.psd1

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)