From 31c6a17acc7f3545b49194fb02a345ec40affc35 Mon Sep 17 00:00:00 2001 From: nohwnd Date: Tue, 5 Mar 2019 07:44:35 +0100 Subject: [PATCH] Fix mock output --- CHANGELOG.md | 4 ++++ Functions/Mock.Tests.ps1 | 9 +++++++++ Functions/Mock.ps1 | 2 -- Pester.psd1 | 4 ++-- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 610f60a60..14de6fa24 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 4.7.1 (March 5, 2019) + +- Fix Mock outputting command metadata + ## 4.7.0 (March 3, 2019) - Fix code coverage when there are multiple packages [#1244](https://github.com/pester/Pester/pull/1244) diff --git a/Functions/Mock.Tests.ps1 b/Functions/Mock.Tests.ps1 index afdcf266b..ecc9de8f2 100644 --- a/Functions/Mock.Tests.ps1 +++ b/Functions/Mock.Tests.ps1 @@ -2198,3 +2198,12 @@ InModuleScope Pester { } } } + +Describe "Mock definition output" { + It "Outputs nothing" { + + function a () {} + $output = Mock a { } + $output | Should -Be $null + } +} diff --git a/Functions/Mock.ps1 b/Functions/Mock.ps1 index 6e6555ee9..6f0e6bbcf 100644 --- a/Functions/Mock.ps1 +++ b/Functions/Mock.ps1 @@ -1562,8 +1562,6 @@ function Repair-ConflictingParameters { $Metadata.Parameters.Add($newName, $paramMetadata) } } - - $Metadata } function Reset-ConflictingParameters { diff --git a/Pester.psd1 b/Pester.psd1 index d670368ef..2b1f2ffaf 100644 --- a/Pester.psd1 +++ b/Pester.psd1 @@ -4,7 +4,7 @@ ModuleToProcess = 'Pester.psm1' # Version number of this module. - ModuleVersion = '4.7.0' + ModuleVersion = '4.7.1' # ID used to uniquely identify this module GUID = 'a699dea5-2c73-4616-a270-1f7abb777e71' @@ -127,7 +127,7 @@ LicenseUri = "https://www.apache.org/licenses/LICENSE-2.0.html" # Release notes for this particular version of the module - ReleaseNotes = 'https://github.com/pester/Pester/releases/tag/4.7.0' + ReleaseNotes = 'https://github.com/pester/Pester/releases/tag/4.7.1' # Prerelease string of this module Prerelease = ''