Created
January 12, 2017 23:03
-
-
Save alx9r/7749f3a0657941d0b5839128dcf19feb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Import-Module Pester | |
Import-Module AzureRM.Resources | |
Get-Command New-AzureRmResourceGroupDeployment | % ModuleName | |
[string](Get-Module AzureRM.Resources).Version | |
$PSVersionTable | |
Push-Location (Get-Module Pester).ModuleBase | |
$allVersions = git tag | | |
% { | |
try { [version]$_ } | |
catch {} | |
} | |
$recentVersions = $allVersions | | |
? { $_.Major -ge 3 } | |
foreach ( $version in $recentVersions ) | |
{ | |
Describe "Checkout Pester $version" { | |
It "git checkout version" { | |
git checkout "tags/$version" 2>&1 | |
} | |
} | |
Write-Host 'Reload Pester' | |
Remove-Module Pester -Force | |
Import-Module Pester -Force | |
Describe "Test with Pester $version" { | |
It 'confirm Pester version' { | |
(Get-Module Pester).Version | Should be $version | |
} | |
Mock New-AzureRmResourceGroupDeployment | |
It 'this throws Exception calling "GetDynamicParameters"' { | |
{ New-AzureRmResourceGroupDeployment -ResourceGroupName Test -TemplateFile Test } | | |
Should throw 'GetDynamicParameters' | |
} | |
} | |
} | |
Pop-Location |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment