Skip to content

Commit

Permalink
add tests for ensure_architecture
Browse files Browse the repository at this point in the history
  • Loading branch information
rrelmy committed Apr 3, 2017
1 parent 0fff49f commit a5b6d86
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/Scoop-Install.Tests.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,27 @@
. "$psscriptroot\..\lib\core.ps1"
. "$psscriptroot\..\lib\manifest.ps1"
. "$psscriptroot\..\lib\install.ps1"
. "$psscriptroot\Scoop-TestLib.ps1"

describe "ensure_architecture" {
it "should keep correct architectures" {
ensure_architecture "32bit" | Should be "32bit"
ensure_architecture "64bit" | Should be "64bit"
}

it "should fallback to the default architecture on empty input" {
ensure_architecture "" | Should be $(default_architecture)
ensure_architecture $null | Should be $(default_architecture)
}

it "should show an error with an invalid architecture" {
Mock abort

ensure_architecture "PPC" | Should be $null
Assert-MockCalled abort -Times 1
}
}

describe "env add and remove path" {
# test data
$manifest = @{
Expand Down

0 comments on commit a5b6d86

Please sign in to comment.