Skip to content

Commit

Permalink
Update tests to work with pester version 4.* (ScoopInstaller#1711)
Browse files Browse the repository at this point in the history
* Remove custom choco options
* Use Install-Module to install Pester
  • Loading branch information
r15ch13 committed Nov 27, 2017
1 parent 8009989 commit 872517b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
3 changes: 1 addition & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion test/Scoop-Alias.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe "add_alias" {
$alias_file | should exist

add_alias "rm" "test"
$alias_file | should contain ""
$alias_file | should FileContentMatch ""
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions test/Scoop-Core.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -35,28 +35,28 @@ 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
}

it "moves directories with spaces in path" -skip:$isUnix {
$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
}

it "moves directories with quotes in path" -skip:$isUnix {
$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
}
}
Expand Down

0 comments on commit 872517b

Please sign in to comment.