Permalink
Browse files

retrofitted all tests with pester mocking

  • Loading branch information...
1 parent 05fb3c7 commit 654703b9d4388eb385776986ce6d0ee53485a146 @mwrock mwrock committed Oct 19, 2012
@@ -1,28 +1,15 @@
#credit to Aaron Lerch on helping me figure out how you can keep the real functions around
-rename-item function:Update-SessionEnvironment Update-SessionEnvironment-Actual
rename-item function:Chocolatey-Help Chocolatey-Help-Actual
-rename-item function:Chocolatey-Install Chocolatey-Install-Actual
-rename-item function:Chocolatey-InstallIfMissing Chocolatey-InstallIfMissing-Actual
rename-item function:Chocolatey-List Chocolatey-List-Actual
rename-item function:Chocolatey-Pack Chocolatey-Pack-Actual
-rename-item function:Chocolatey-PackagesConfig Chocolatey-PackagesConfig-Actual
rename-item function:Chocolatey-Push Chocolatey-Push-Actual
-rename-item function:Chocolatey-RubyGem Chocolatey-RubyGem-Actual
rename-item function:Chocolatey-Update Chocolatey-Update-Actual
-rename-item function:Chocolatey-Version Chocolatey-Version-Actual
-rename-item function:Chocolatey-WebPI Chocolatey-WebPI-Actual
-rename-item function:Chocolatey-WindowsFeatures Chocolatey-WindowsFeatures-Actual
rename-item function:Chocolatey-Cygwin Chocolatey-Cygwin-Actual
rename-item function:Delete-ExistingErrorLog Delete-ExistingErrorLog-Actual
rename-item function:Generate-BinFile Generate-BinFile-Actual
rename-item function:Get-ChocolateyBins Get-ChocolateyBins-Actual
-rename-item function:Get-ConfigValue Get-ConfigValue-Actual
rename-item function:Get-LatestPackageVersion Get-LatestPackageVersion-Actual
-rename-item function:Get-LongPackageVersion Get-LongPackageVersion-Actual
-rename-item function:Get-PackageFolderVersions Get-PackageFolderVersions-Actual
-rename-item function:Get-PackageFoldersForPackage Get-PackageFoldersForPackage-Actual
-rename-item function:Get-VersionsForComparison Get-VersionsForComparison-Actual
rename-item function:Remove-LastInstallLog Remove-LastInstallLog-Actual
rename-item function:Run-ChocolateyProcess Run-ChocolateyProcess-Actual
@@ -1,20 +0,0 @@
-function Chocolatey-Install {
-param(
- [string] $packageName,
- [string] $source,
- [string] $version,
- [string] $installerArguments
-)
-
- $script:chocolatey_install_was_called = $true
- $script:packageName = $packageName
- $script:source = $source
- $script:version = $version
- $script:installerArguments = $installerArguments
-
- if ($script:exec_chocolatey_install_actual) {
- Chocolatey-Install-Actual @PSBoundParameters
- } else {
- return $script:chocolatey_install_return_value
- }
-}
@@ -1,14 +0,0 @@
-function Chocolatey-InstallIfMissing {
-param(
- [string] $packageName,
- [string] $source,
- [string] $version
-)
-
- $script:chocolatey_installifmissing_was_called = $true
- $script:packageName = $packageName
- $script:source = $source
- $script:version = $version
-
- if ($script:exec_chocolatey_installifmissing_actual) { Chocolatey-InstallIfMissing-Actual @PSBoundParameters}
-}
@@ -1,10 +0,0 @@
-function Chocolatey-PackagesConfig {
-param(
- [string] $packagesConfigPath
-)
-
- $script:chocolatey_packagesconfig_was_called = $true
- $script:packagesConfigPath = $packagesConfigPath
-
- if ($script:exec_chocolatey_packagesconfig_actual) { Chocolatey-PackagesConfig-Actual @PSBoundParameters}
-}
@@ -1,16 +0,0 @@
-function Chocolatey-Version {
-param(
- [string] $packageName,
- [string] $source
-)
- $script:chocolatey_version_was_called = $true
- $script:packageName = $packageName
- $script:source = $source
-
- if ($script:exec_chocolatey_version_actual) {
- Chocolatey-Version-Actual @PSBoundParameters
- }
- else {
- return $script:chocolatey_version_return_value
- }
-}
@@ -1,17 +0,0 @@
-function Get-ConfigValue {
-param(
- [Parameter(Mandatory = $true)]
- [ValidateNotNullOrEmpty()]
- [string] $configValue
-)
-
- $script:get_configvalue_was_called = $true
- $script:configValue = $configValue
-
- if ($script:exec_get_configvalue_actual) {
- $script:get_configvalue_actual_was_called = $true
- Get-ConfigValue-Actual @PSBoundParameters
- } else {
- return $script:get_configvalue_return_value
- }
-}
@@ -1,15 +0,0 @@
-function Get-LongPackageVersion {
-param(
- [string] $packageVersion
-)
-
- $script:get_longpackageversion_was_called = $true
- $script:packageVersion = $packageVersion
-
- if ($script:exec_get_longpackageversion_actual) {
- $script:get_longpackageversion_actual_was_called = $true
- Get-LongPackageVersion-Actual @PSBoundParameters
- } else {
- return $script:get_longpackageversion_return_value
- }
-}
@@ -1,15 +0,0 @@
-function Get-PackageFolderVersions {
-param(
- [string] $packageName
-)
-
- $script:get_packagefolderversions_was_called = $true
- $script:packageName = $packageName
-
- if ($script:exec_get_packagefolderversions_actual) {
- $script:get_packagefolderversions_actual_was_called = $true
- Get-PackageFolderVersions-Actual @PSBoundParameters
- } else {
- return $script:get_packagefolderversions_return_value
- }
-}
@@ -1,15 +0,0 @@
-function Get-PackageFoldersForPackage {
-param(
- [string] $packageName
-)
-
- $script:get_packagefoldersforpackage_was_called = $true
- $script:packageName = $packageName
-
- if ($script:exec_get_packagefoldersforpackage_actual) {
- $script:get_packagefoldersforpackage_actual_was_called = $true
- Get-PackageFoldersForPackage-Actual @PSBoundParameters
- } else {
- return $script:get_packagefoldersforpackage_return_value
- }
-}
@@ -1,15 +0,0 @@
-function Get-VersionsForComparison {
-param (
- $packageVersions = @()
-)
-
- $script:get_versionsforcomparison_was_called = $true
- $script:packageVersions = $packageVersions
-
- if ($script:exec_get_versionsforcomparison_actual) {
- $script:get_versionsforcomparison_actual_was_called = $true
- Get-VersionsForComparison-Actual @PSBoundParameters
- } else {
- return $script:get_versionsforcomparison_return_value
- }
-}
@@ -1,6 +0,0 @@
-function Update-SessionEnvironment {
-
- $script:update_sessionenvironment_was_called = $true
-
- if ($script:exec_update_sessionenvironment_actual) { Update-SessionEnvironment-Actual}
-}
Oops, something went wrong.

0 comments on commit 654703b

Please sign in to comment.