Skip to content

Instantly share code, notes, and snippets.

@scottmuc
Forked from ferventcoder/1.WhatIHaveToDo.ps1
Created January 2, 2012 15:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scottmuc/1551116 to your computer and use it in GitHub Desktop.
Save scottmuc/1551116 to your computer and use it in GitHub Desktop.
Pester - Script variables should reset for every describe
Describe "When installing packages from a packages.config manifest" {
$script:chocolatey_nuget_was_called = $false
$script:chocolatey_rubygem_was_called = $false
$script:chocolatey_webpi_was_called = $false
$script:packageName = ''
$script:version = ''
# content here
}
Describe "When installing packages from a packages.config manifest that doesn't exist" {
$script:chocolatey_nuget_was_called = $false
$script:chocolatey_rubygem_was_called = $false
$script:chocolatey_webpi_was_called = $false
$script:packageName = ''
$script:version = ''
# content here
}
Before "setup chocolatey variables" {
$script:chocolatey_nuget_was_called = $false
$script:chocolatey_rubygem_was_called = $false
$script:chocolatey_webpi_was_called = $false
$script:packageName = ''
$script:version = ''
}
Describe "When installing packages from a packages.config manifest" {
# content here
}
Describe "When installing packages from a packages.config manifest that doesn't exist" {
# content here
}
function Initialize-Variables {
$script:chocolatey_nuget_was_called = $false
$script:chocolatey_rubygem_was_called = $false
$script:chocolatey_webpi_was_called = $false
$script:packageName = ''
$script:version = ''
}
Describe "When installing packages from a packages.config manifest" {
Initialize-Variables
# content here
}
Describe "When installing packages from a packages.config manifest that doesn't exist" {
Initialize-Variables
# content here
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment