Skip to content

Commit f9572e2

Browse files
committed
Merge branch 'master' of https://github.com/alx9r/WindowsShell
2 parents efd5787 + 7b1012b commit f9572e2

File tree

3 files changed

+23
-17
lines changed

3 files changed

+23
-17
lines changed

Functions/processShellLibrary.Tests.ps1

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ Describe 'Invoke-ProcessShellLibrary -Ensure Present' {
5656
Mock Set-ShellLibraryProperty -Verifiable
5757
Context 'absent, Set' {
5858
Mock Add-ShellLibrary {
59-
New-Object ShellLibrary -Property @{
59+
New-Object psobject -Property @{
6060
Name = 'libary name'
6161
}
6262
} -Verifiable
6363
It 'returns nothing' {
64-
$object = New-Object ShellLibrary -Property @{
64+
$object = New-Object psobject -Property @{
6565
Name = 'library name'
6666
TypeName = 'Pictures'
6767
StockIconName = 'Application'
@@ -93,7 +93,7 @@ Describe 'Invoke-ProcessShellLibrary -Ensure Present' {
9393
}
9494
} -Verifiable
9595
It 'returns nothing' {
96-
$object = New-Object ShellLibrary -Property @{
96+
$object = New-Object psobject -Property @{
9797
Name = 'library name'
9898
TypeName = 'Pictures'
9999
IconFilePath = 'c:\folder\some.exe'
@@ -124,7 +124,7 @@ Describe 'Invoke-ProcessShellLibrary -Ensure Present' {
124124
}
125125
} -Verifiable
126126
It 'returns nothing' {
127-
$object = New-Object ShellLibrary -Property @{
127+
$object = New-Object psobject -Property @{
128128
Name = 'library name'
129129
TypeName = 'Pictures'
130130
StockIconName = 'Application'
@@ -155,7 +155,7 @@ Describe 'Invoke-ProcessShellLibrary -Ensure Present' {
155155
}
156156
} -Verifiable
157157
It 'returns nothing' {
158-
$object = New-Object ShellLibrary -Property @{
158+
$object = New-Object psobject -Property @{
159159
Name = 'library name'
160160
}
161161
$r = $object | Invoke-ProcessShellLibrary Set
@@ -189,7 +189,7 @@ Describe 'Invoke-ProcessShellLibrary -Ensure Present' {
189189
}
190190
Context 'absent, Test' {
191191
It 'returns false' {
192-
$object = New-Object ShellLibrary -Property @{
192+
$object = New-Object psobject -Property @{
193193
Name = 'library name'
194194
TypeName = 'Pictures'
195195
StockIconName = 'Application'
@@ -216,7 +216,7 @@ Describe 'Invoke-ProcessShellLibrary -Ensure Present' {
216216
}
217217
} -Verifiable
218218
It 'returns nothing' {
219-
$object = New-Object ShellLibrary -Property @{
219+
$object = New-Object psobject -Property @{
220220
Name = 'library name'
221221
TypeName = 'Pictures'
222222
StockIconName = 'Application'
@@ -242,7 +242,7 @@ Describe 'Invoke-ProcessShellLibrary -Ensure Present' {
242242
}
243243
} -Verifiable
244244
It 'returns true' {
245-
$object = New-Object ShellLibrary -Property @{
245+
$object = New-Object psobject -Property @{
246246
Name = 'library name'
247247
TypeName = 'Pictures'
248248
StockIconName = 'Application'
@@ -269,7 +269,7 @@ Describe 'Invoke-ProcessShellLibrary -Ensure Present' {
269269
}
270270
} -Verifiable
271271
It 'returns false' {
272-
$object = New-Object ShellLibrary -Property @{
272+
$object = New-Object psobject -Property @{
273273
Name = 'library name'
274274
TypeName = 'Music'
275275
StockIconName = 'Application'
@@ -296,7 +296,7 @@ Describe 'Invoke-ProcessShellLibrary -Ensure Present' {
296296
}
297297
} -Verifiable
298298
It 'returns false' {
299-
$object = New-Object ShellLibrary -Property @{
299+
$object = New-Object psobject -Property @{
300300
Name = 'library name'
301301
TypeName = 'Pictures'
302302
StockIconName = 'Application'
@@ -326,7 +326,7 @@ Describe 'Invoke-ProcessShellLibrary -Ensure Absent' {
326326
Mock Set-ShellLibraryProperty -Verifiable
327327
Context 'absent, Set' {
328328
It 'returns nothing' {
329-
$object = New-Object ShellLibrary -Property @{
329+
$object = New-Object psobject -Property @{
330330
Name = 'library name'
331331
TypeName = 'Pictures'
332332
StockIconName = 'Application'
@@ -346,7 +346,7 @@ Describe 'Invoke-ProcessShellLibrary -Ensure Absent' {
346346
}
347347
Context 'absent, Test' {
348348
It 'returns true' {
349-
$object = New-Object ShellLibrary -Property @{
349+
$object = New-Object psobject -Property @{
350350
Name = 'library name'
351351
TypeName = 'Pictures'
352352
StockIconName = 'Application'
@@ -374,7 +374,7 @@ Describe 'Invoke-ProcessShellLibrary -Ensure Absent' {
374374
}
375375
} -Verifiable
376376
It 'returns nothing' {
377-
$object = New-Object ShellLibrary -Property @{
377+
$object = New-Object psobject -Property @{
378378
Name = 'library name'
379379
TypeName = 'Pictures'
380380
StockIconName = 'Application'
@@ -401,7 +401,7 @@ Describe 'Invoke-ProcessShellLibrary -Ensure Absent' {
401401
}
402402
} -Verifiable
403403
It 'returns false' {
404-
$object = New-Object ShellLibrary -Property @{
404+
$object = New-Object psobject -Property @{
405405
Name = 'library name'
406406
TypeName = 'Pictures'
407407
StockIconName = 'Application'

IntegrationTests/shellLibraryFolderResource.Tests.ps1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,11 @@ Describe 'ShellLibraryFolder Resource' {
1212
$r.Name | Should be 'ShellLibraryFolder'
1313
}
1414
Context 'set up' {
15+
It 'load module' {
16+
$h.m = Import-Module "$((Get-Module WindowsShell).ModuleBase)\ShellLibraryFolder.psm1" -PassThru
17+
}
1518
It 'create object' {
16-
$h.d = (Get-Module WindowsShell).NewBoundScriptBlock({
19+
$h.d = $h.m.NewBoundScriptBlock({
1720
[ShellLibraryFolder]::new()
1821
}).InvokeReturnAsIs()
1922
}

IntegrationTests/shellLibraryResource.Tests.ps1

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@ Describe 'ShellLibrary Resource' {
99
$r = Get-DscResource ShellLibrary WindowsShell
1010
$r.Name | Should be 'ShellLibrary'
1111
}
12+
It 'load module' {
13+
$h.m = Import-Module "$((Get-Module WindowsShell).ModuleBase)\ShellLibrary.psm1" -PassThru
14+
}
1215
It 'create object' {
13-
$h.d = (Get-Module WindowsShell).NewBoundScriptBlock({
16+
$h.d = $h.m.NewBoundScriptBlock({
1417
[ShellLibrary]::new()
1518
}).InvokeReturnAsIs()
1619
}
@@ -53,7 +56,7 @@ Describe 'ShellLibrary Resource' {
5356
}
5457
Context 'IconFilePath' {
5558
It 're-create theh object' {
56-
$h.d = (Get-Module WindowsShell).NewBoundScriptBlock({
59+
$h.d = $h.m.NewBoundScriptBlock({
5760
[ShellLibrary]::new()
5861
}).InvokeReturnAsIs()
5962
$h.d.Name = $libraryName

0 commit comments

Comments
 (0)