From 8097c28948ebe75d83018c0ed2651f1823e53b5e Mon Sep 17 00:00:00 2001 From: Keith Hill Date: Sun, 14 Jan 2018 23:01:14 -0700 Subject: [PATCH] Config Travis bld to only run tests in test dir --- .travis.yml | 2 +- chocolatey/tests/InstallChocolatey.Tests.ps1 | 17 +++++------------ 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/.travis.yml b/.travis.yml index ef44a52bf..29517294b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,4 +35,4 @@ jobs: - pwsh -c 'Install-Module Pester -Scope CurrentUser' script: - - pwsh -c 'Import-Module Pester; Invoke-Pester -EnableExit' + - pwsh -c 'Import-Module Pester; Invoke-Pester -Script test -EnableExit' diff --git a/chocolatey/tests/InstallChocolatey.Tests.ps1 b/chocolatey/tests/InstallChocolatey.Tests.ps1 index b8c27bd1b..89e912aa4 100644 --- a/chocolatey/tests/InstallChocolatey.Tests.ps1 +++ b/chocolatey/tests/InstallChocolatey.Tests.ps1 @@ -1,11 +1,5 @@ $packageName = "poshgit" -if (($PSVersionTable.PSVersion.Major -lt 6) -or $IsWindows) { - cpack - $binRoot = join-path $env:systemdrive 'tools' - if($null -ne $env:chocolatey_bin_root){$binRoot = join-path $env:systemdrive $env:chocolatey_bin_root} - $poshgitPath = join-path $binRoot 'poshgit' - if(Test-Path $Profile) { $currentProfileScript = (Get-Content $Profile) } -} +cpack function Setup-Environment { Cleanup @@ -26,17 +20,16 @@ function Clean-Temp { function RunInstall { cinst $packageName -source (Resolve-Path .) } +$binRoot = join-path $env:systemdrive 'tools' +if($null -ne $env:chocolatey_bin_root){$binRoot = join-path $env:systemdrive $env:chocolatey_bin_root} +$poshgitPath = join-path $binRoot 'poshgit' +if(Test-Path $Profile) { $currentProfileScript = (Get-Content $Profile) } function Clean-Environment { Set-Content $Profile -value $currentProfileScript -Force } Describe "Install-Posh-Git" { - BeforeAll { - if (($PSVersionTable.PSVersion.Major -ge 6) -and !$IsWindows) { - $PSDefaultParameterValues["it:skip"] = $true - } - } It "WillRemvePreviousInstallVersion" { Setup-Environment try{