From 523dcd1ca4f2b32fadd2511a813439771a65cad2 Mon Sep 17 00:00:00 2001 From: Chris Hunt Date: Mon, 12 Sep 2016 13:14:04 -0400 Subject: [PATCH] Fix some tests and update docs for release --- ReleaseNotes.md | 7 +++++++ Tests/poshspec.Tests.ps1 | 19 ++++++++++++++++--- poshspec.psd1 | Bin 8004 -> 8004 bytes 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/ReleaseNotes.md b/ReleaseNotes.md index 462af22..e25afda 100644 --- a/ReleaseNotes.md +++ b/ReleaseNotes.md @@ -1,3 +1,10 @@ +# Version 2.1.14 +* Improved handling of single quotes in Package function +* Added Functions for + * LocalUser + * AuditPolicy + * Volume + # Version 2.1.6 * Added Functions for * Firewall diff --git a/Tests/poshspec.Tests.ps1 b/Tests/poshspec.Tests.ps1 index b82ffd6..4774f0c 100644 --- a/Tests/poshspec.Tests.ps1 +++ b/Tests/poshspec.Tests.ps1 @@ -189,10 +189,10 @@ Describe 'Test Functions' { } It 'Should return a correct text expression' { - $results.Expression | Should Be "Get-Package -Name 'Microsoft Visual Studio Code' -ErrorAction SilentlyContinue | Should Not BeNullOrEmpty" + $results.Expression | Should Be 'Get-Package -Name "Microsoft Visual Studio Code" -ErrorAction SilentlyContinue | Select-Object -First 1 | Should Not BeNullOrEmpty' } } - + Context 'Package w/ properties' { $results = Package 'Microsoft Visual Studio Code' version { Should be '1.1.0' } @@ -202,7 +202,20 @@ Describe 'Test Functions' { } It 'Should return a correct text expression' { - $results.Expression | Should Be "Get-Package -Name 'Microsoft Visual Studio Code' -ErrorAction SilentlyContinue | Select-Object -ExpandProperty 'version' | Should be '1.1.0'" + $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'" + } + } + + Context 'Package w/Single Quotes' { + + $results = Package "Name 'subname'" { Should Not BeNullOrEmpty } + + It 'Should return a correct test name' { + $results.Name | Should Be "Package 'Name 'subname'' Should Not BeNullOrEmpty" + } + + It 'Should return a correct text expression' { + $results.Expression | Should Be "Get-Package -Name ""Name 'subname'"" -ErrorAction SilentlyContinue | Select-Object -First 1 | Should Not BeNullOrEmpty" } } diff --git a/poshspec.psd1 b/poshspec.psd1 index 416d2e4a2aa0326283ec1de308515c3ff1d3c99a..6715cff1e7e857a8b10be670c895214fd40acf06 100644 GIT binary patch delta 25 hcmX?Ncf@YOK6Xn6eFj4Yqm4%s85vDBt24>U0swE92S@+_ delta 25 hcmX?Ncf@YOK6Y~keFh^2vyDd+85xZ>t24>U0swEN2T1?`