-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSetup.Tests.ps1
More file actions
67 lines (61 loc) · 2.22 KB
/
Copy pathSetup.Tests.ps1
File metadata and controls
67 lines (61 loc) · 2.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
BeforeDiscovery {
$modules = @(
@{ module = "posh-git" }
@{ module = "PSFzf" }
@{ module = "PSScriptAnalyzer" }
)
}
Describe "Modules" {
It "<module>" -ForEach $modules {
Install-Module -Name $module -Force
$installed = $(Get-InstalledModule -Name $module).Name
$installed | Should -BeLike $module
}
}
BeforeDiscovery {
$table = @(
@{ Path = "$env:APPDATA\Code\User\keybindings.json" ; Target = "$env:USERPROFILE\.config\dotfiles\vscode\keybindings.json" }
@{ Path = "$env:APPDATA\Code\User\settings.json" ; Target = "$env:USERPROFILE\.config\dotfiles\vscode\settings.json" }
@{ Path = "$env:LOCALAPPDATA\nvim" ; Target = "$env:USERPROFILE\.config\dotfiles\nvim" }
@{ Path = "$env:USERPROFILE\.config\starship.toml" ; Target = "$env:USERPROFILE\.config\dotfiles\starship\starship.toml" }
@{ Path = "$env:USERPROFILE\.gitconfig" ; Target = "$env:USERPROFILE\.config\dotfiles\git\.gitconfig" }
@{ Path = "$env:USERPROFILE\.glzr" ; Target = "$env:USERPROFILE\.config\dotfiles\glzr" }
@{ Path = "$env:USERPROFILE\Documents\PowerShell" ; Target = "$env:USERPROFILE\.config\dotfiles\PowerShell" }
)
foreach ($item in $table) {
$item.Name = Split-Path -Leaf $item.Path
}
}
Describe "Symbolic Links" {
Context "<name>" -ForEach $table {
BeforeEach {
New-Item -ItemType SymbolicLink -Path $path -Target $target -Force
}
It "created" {
Test-Path $target | Should -Be $true
}
}
}
BeforeDiscovery {
$packages = @(
@{ package = "Git.Git" }
@{ package = "Neovim.Neovim" }
@{ package = "glzr-io.glazewm" }
@{ package = "Microsoft.Sysinternals.ZoomIt" }
@{ package = "Microsoft.NuGet" }
@{ package = "junegunn.fzf" }
@{ package = "sharkdp.bat" }
@{ package = "sharkdp.fd" }
)
}
Describe "Install" {
Context "<package>" -ForEach $packages {
BeforeEach {
winget install $package
$result = winget show $package
}
It "Installed" {
$result | Should-NotBeNull
}
}
}