From 872517b8980fb9fd2ed8b60304674e22693fc8f7 Mon Sep 17 00:00:00 2001 From: Richard Kuhnt Date: Mon, 27 Nov 2017 15:27:38 +0100 Subject: [PATCH] Update tests to work with pester version 4.* (#1711) * Remove custom choco options * Use Install-Module to install Pester --- appveyor.yml | 3 +-- test/Scoop-Alias.Tests.ps1 | 2 +- test/Scoop-Core.Tests.ps1 | 8 ++++---- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 4e72d287f4..744530d93e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -6,8 +6,7 @@ branches: init: - ps: (get-psprovider 'FileSystem').Home = $(pwd) - - ps: "if($env:APPVEYOR_CHOCO_PESTER_OPTIONS -ne $null) { write-host -f yellow 'NOTE: customized `pester` installation is being used' }" - - ps: choco install -y pester $env:APPVEYOR_CHOCO_PESTER_OPTIONS + - ps: Install-Module -Name Pester -Repository PSGallery -Force build: off diff --git a/test/Scoop-Alias.Tests.ps1 b/test/Scoop-Alias.Tests.ps1 index e8ca8bcf0d..a519ec3f37 100644 --- a/test/Scoop-Alias.Tests.ps1 +++ b/test/Scoop-Alias.Tests.ps1 @@ -27,7 +27,7 @@ describe "add_alias" { $alias_file | should exist add_alias "rm" "test" - $alias_file | should contain "" + $alias_file | should FileContentMatch "" } } } diff --git a/test/Scoop-Core.Tests.ps1 b/test/Scoop-Core.Tests.ps1 index 008dfd0b99..220573f7b8 100644 --- a/test/Scoop-Core.Tests.ps1 +++ b/test/Scoop-Core.Tests.ps1 @@ -35,7 +35,7 @@ describe "movedir" { $dir = "$working_dir\user" movedir "$dir\_tmp\$extract_dir" "$dir\$extract_to" - "$dir\test.txt" | should contain "this is the one" + "$dir\test.txt" | should FileContentMatch "this is the one" "$dir\_tmp\$extract_dir" | should not exist } @@ -43,12 +43,12 @@ describe "movedir" { $dir = "$working_dir\user with space" movedir "$dir\_tmp\$extract_dir" "$dir\$extract_to" - "$dir\test.txt" | should contain "this is the one" + "$dir\test.txt" | should FileContentMatch "this is the one" "$dir\_tmp\$extract_dir" | should not exist # test trailing \ in from dir movedir "$dir\_tmp\$null" "$dir\another" - "$dir\another\test.txt" | should contain "testing" + "$dir\another\test.txt" | should FileContentMatch "testing" "$dir\_tmp" | should not exist } @@ -56,7 +56,7 @@ describe "movedir" { $dir = "$working_dir\user with 'quote" movedir "$dir\_tmp\$extract_dir" "$dir\$extract_to" - "$dir\test.txt" | should contain "this is the one" + "$dir\test.txt" | should FileContentMatch "this is the one" "$dir\_tmp\$extract_dir" | should not exist } }