Implement testing using Pester

Integrate with AppVeyor
This commit is contained in:
Simon Hartcher 2015-04-10 23:37:24 +10:00
parent ca3a0ae014
commit 3741af6fa3

View File

@ -7,19 +7,26 @@
"extract_dir": "pester-3.3.6", "extract_dir": "pester-3.3.6",
"bin": "bin\\pester.bat", "bin": "bin\\pester.bat",
"post_install": " "post_install": "
if(!(test-path $profile)) {
$profile_dir = split-path $profile
if(!(test-path $profile_dir)) { mkdir $profile_dir > $null }
'' > $profile
}
$import = \"try { `$null = gcm pester -ea stop; import-module `\"$dir\\pester.psm1`\" } catch { }\" $import = \"try { `$null = gcm pester -ea stop; import-module `\"$dir\\pester.psm1`\" } catch { }\"
$text = get-content $profile
if (($text | sls 'pester') -eq $null) {
$new_profile = @($text) + $import
$new_profile > $profile
}
if($profile) {
'adding pester to powershell profile...'
if(!(test-path $profile)) {
'powershell profile doesn''t exist. creating...'
$profile_dir = split-path $profile
if(!(test-path $profile_dir)) { mkdir $profile_dir > $null }
'' > $profile
}
$text = get-content $profile
if (($text | sls 'pester') -eq $null) {
$new_profile = @($text) + $import
$new_profile > $profile
success 'pester added to powershell profile.'
}
} else { warn 'no powershell profile found. the pester module will not be imported each session.' }
'importing pester for current session...'
iex \"$import\" iex \"$import\"
" "
} }