1
1
. " $PSScriptRoot \Scoop-TestLib.ps1"
2
2
. " $PSScriptRoot \..\lib\core.ps1"
3
3
. " $PSScriptRoot \..\lib\install.ps1"
4
- . " $PSScriptRoot \..\lib\unix.ps1"
5
4
6
5
$repo_dir = (Get-Item $MyInvocation.MyCommand.Path ).directory.parent.FullName
7
- $isUnix = is_unix
8
6
9
7
Describe ' Get-AppFilePath' - Tag ' Scoop' {
10
8
BeforeAll {
@@ -128,23 +126,23 @@ Describe 'is_directory' -Tag 'Scoop' {
128
126
}
129
127
}
130
128
131
- Describe ' movedir' - Tag ' Scoop' {
129
+ Describe ' movedir' - Tag ' Scoop' , ' Windows ' {
132
130
$extract_dir = ' subdir'
133
131
$extract_to = $null
134
132
135
133
BeforeAll {
136
134
$working_dir = setup_working ' movedir'
137
135
}
138
136
139
- It ' moves directories with no spaces in path' - Skip: $isUnix {
137
+ It ' moves directories with no spaces in path' {
140
138
$dir = " $working_dir \user"
141
139
movedir " $dir \_tmp\$extract_dir " " $dir \$extract_to "
142
140
143
141
" $dir \test.txt" | Should - FileContentMatch ' this is the one'
144
142
" $dir \_tmp\$extract_dir " | Should -Not - Exist
145
143
}
146
144
147
- It ' moves directories with spaces in path' - Skip: $isUnix {
145
+ It ' moves directories with spaces in path' {
148
146
$dir = " $working_dir \user with space"
149
147
movedir " $dir \_tmp\$extract_dir " " $dir \$extract_to "
150
148
@@ -157,7 +155,7 @@ Describe 'movedir' -Tag 'Scoop' {
157
155
" $dir \_tmp" | Should -Not - Exist
158
156
}
159
157
160
- It ' moves directories with quotes in path' - Skip: $isUnix {
158
+ It ' moves directories with quotes in path' {
161
159
$dir = " $working_dir \user with 'quote"
162
160
movedir " $dir \_tmp\$extract_dir " " $dir \$extract_to "
163
161
@@ -166,14 +164,14 @@ Describe 'movedir' -Tag 'Scoop' {
166
164
}
167
165
}
168
166
169
- Describe ' shim' - Tag ' Scoop' {
167
+ Describe ' shim' - Tag ' Scoop' , ' Windows ' {
170
168
BeforeAll {
171
169
$working_dir = setup_working ' shim'
172
170
$shimdir = shimdir
173
171
$ (ensure_in_path $shimdir ) | Out-Null
174
172
}
175
173
176
- It " links a file onto the user's path" - Skip: $isUnix {
174
+ It " links a file onto the user's path" {
177
175
{ Get-Command ' shim-test' - ea stop } | Should - Throw
178
176
{ Get-Command ' shim-test.ps1' - ea stop } | Should - Throw
179
177
{ Get-Command ' shim-test.cmd' - ea stop } | Should - Throw
@@ -187,7 +185,7 @@ Describe 'shim' -Tag 'Scoop' {
187
185
}
188
186
189
187
Context ' user with quote' {
190
- It ' shims a file with quote in path' - Skip: $isUnix {
188
+ It ' shims a file with quote in path' {
191
189
{ Get-Command ' shim-test' - ea stop } | Should - Throw
192
190
{ shim- test } | Should - Throw
193
191
@@ -202,14 +200,14 @@ Describe 'shim' -Tag 'Scoop' {
202
200
}
203
201
}
204
202
205
- Describe ' rm_shim' - Tag ' Scoop' {
203
+ Describe ' rm_shim' - Tag ' Scoop' , ' Windows ' {
206
204
BeforeAll {
207
205
$working_dir = setup_working ' shim'
208
206
$shimdir = shimdir
209
207
$ (ensure_in_path $shimdir ) | Out-Null
210
208
}
211
209
212
- It ' removes shim from path' - Skip: $isUnix {
210
+ It ' removes shim from path' {
213
211
shim " $working_dir \shim-test.ps1" $false ' shim-test'
214
212
215
213
rm_shim ' shim-test' $shimdir
@@ -221,19 +219,19 @@ Describe 'rm_shim' -Tag 'Scoop' {
221
219
}
222
220
}
223
221
224
- Describe ' get_app_name_from_shim' - Tag ' Scoop' {
222
+ Describe ' get_app_name_from_shim' - Tag ' Scoop' , ' Windows ' {
225
223
BeforeAll {
226
224
$working_dir = setup_working ' shim'
227
225
$shimdir = shimdir
228
226
$ (ensure_in_path $shimdir ) | Out-Null
229
227
Mock appsdir { $working_dir }
230
228
}
231
229
232
- It ' returns empty string if file does not exist' - Skip: $isUnix {
230
+ It ' returns empty string if file does not exist' {
233
231
get_app_name_from_shim ' non-existent-file' | Should - Be ' '
234
232
}
235
233
236
- It ' returns app name if file exists and is a shim to an app' - Skip: $isUnix {
234
+ It ' returns app name if file exists and is a shim to an app' {
237
235
ensure " $working_dir /mockapp/current/"
238
236
Write-Output ' ' | Out-File " $working_dir /mockapp/current/mockapp1.ps1"
239
237
shim " $working_dir /mockapp/current/mockapp1.ps1" $false ' shim-test1'
@@ -246,7 +244,7 @@ Describe 'get_app_name_from_shim' -Tag 'Scoop' {
246
244
get_app_name_from_shim " $shim_path2 " | Should - Be ' mockapp'
247
245
}
248
246
249
- It ' returns empty string if file exists and is not a shim' - Skip: $isUnix {
247
+ It ' returns empty string if file exists and is not a shim' {
250
248
Write-Output ' lorem ipsum' | Out-File - Encoding ascii " $working_dir /mock-shim.ps1"
251
249
get_app_name_from_shim " $working_dir /mock-shim.ps1" | Should - Be ' '
252
250
}
@@ -263,12 +261,12 @@ Describe 'get_app_name_from_shim' -Tag 'Scoop' {
263
261
}
264
262
}
265
263
266
- Describe ' ensure_robocopy_in_path' - Tag ' Scoop' {
264
+ Describe ' ensure_robocopy_in_path' - Tag ' Scoop' , ' Windows ' {
267
265
$shimdir = shimdir $false
268
266
Mock versiondir { $repo_dir }
269
267
270
268
Context ' robocopy is not in path' {
271
- It ' shims robocopy when not on path' - Skip: $isUnix {
269
+ It ' shims robocopy when not on path' {
272
270
Mock Test-CommandAvailable { $false }
273
271
Test-CommandAvailable robocopy | Should - Be $false
274
272
@@ -283,7 +281,7 @@ Describe 'ensure_robocopy_in_path' -Tag 'Scoop' {
283
281
}
284
282
285
283
Context ' robocopy is in path' {
286
- It ' does not shim robocopy when it is in path' - Skip: $isUnix {
284
+ It ' does not shim robocopy when it is in path' {
287
285
Mock Test-CommandAvailable { $true }
288
286
Test-CommandAvailable robocopy | Should - Be $true
289
287
0 commit comments