@@ -32,35 +32,38 @@ Describe "Remove-AllPSBookmarks" {
3232Describe " Add-PSBookmark" {
3333
3434 It " adds current folder to bookmarks" {
35+ $_marks = @ { }
3536 Mock - CommandName Import-Csv - MockWith {} - Verifiable
3637 Mock - CommandName Export-Csv - MockWith {} - Verifiable
3738
3839 Set-Location $here
39- Add-PSBookmark testDir
40+ Add-PSBookmark testDir1
4041 $_marks.Count | Should - Be 1
41- $_marks.Keys | Should - Be " testDir "
42+ $_marks.Keys | Should - Be " testDir1 "
4243 $_marks.Values | Should - Be $here
4344 }
4445
4546 It " adds selected folder to bookmarks" {
47+ $_marks = @ { }
4648 Mock - CommandName Import-Csv - MockWith {} - Verifiable
4749 Mock - CommandName Export-Csv - MockWith {} - Verifiable
4850
49- Add-PSBookmark testDir " c:"
51+ Add-PSBookmark testDir2 " c:"
5052 $_marks = Get-PSBookmarks
5153 $_marks.Count | Should - Be 1
52- $_marks.Keys | Should - Be " testDir "
54+ $_marks.Keys | Should - Be " testDir2 "
5355 $_marks.Values | Should - Be " c:"
5456 }
5557
5658 It " adds path from pipeline to bookmarks" {
59+ $_marks = @ { }
5760 Mock - CommandName Import-Csv - MockWith {} - Verifiable
5861 Mock - CommandName Export-Csv - MockWith {} - Verifiable
5962
60- " c:" | Add-PSBookmark testDir
63+ " c:" | Add-PSBookmark testDir3
6164 $_marks = Get-PSBookmarks
6265 $_marks.Count | Should - Be 1
63- $_marks.Keys | Should - Be " testDir "
66+ $_marks.Keys | Should - Be " testDir3 "
6467 $_marks.Values | Should - Be " c:"
6568 }
6669}
@@ -112,41 +115,44 @@ Describe "Open-PSBookmark" {
112115Describe " Update-PSBookmark" {
113116
114117 It " update current folder to bookmarks" {
118+ $_marks = @ { }
115119 Mock - CommandName Import-Csv - MockWith {} - Verifiable
116120 Mock - CommandName Export-Csv - MockWith {} - Verifiable
117121
118- Add-PSBookmark testDir " c:"
122+ Add-PSBookmark testDir1 " c:"
119123
120124 Set-Location $here
121- Update-PSBookmark testDir
125+ Update-PSBookmark testDir1
122126 $_marks.Count | Should - Be 1
123- $_marks.Keys | Should - Be " testDir "
127+ $_marks.Keys | Should - Be " testDir1 "
124128 $_marks.Values | Should - Be $here
125129 }
126130
127131 It " Update selected folder in bookmarks list" {
132+ $_marks = @ { }
128133 Mock - CommandName Import-Csv - MockWith {} - Verifiable
129134 Mock - CommandName Export-Csv - MockWith {} - Verifiable
130135
131- Add-PSBookmark testDir " c:"
136+ Add-PSBookmark testDir2 " c:"
132137
133- Update-PSBookmark testDir " $pwd "
138+ Update-PSBookmark testDir2 " $pwd "
134139 $_marks = Get-PSBookmarks
135140 $_marks.Count | Should - Be 1
136- $_marks.Keys | Should - Be " testDir "
141+ $_marks.Keys | Should - Be " testDir2 "
137142 $_marks.Values | Should - Be " $pwd "
138143 }
139144
140145 It " Update path from pipeline to bookmarks" {
146+ $_marks = @ { }
141147 Mock - CommandName Import-Csv - MockWith {} - Verifiable
142148 Mock - CommandName Export-Csv - MockWith {} - Verifiable
143149
144- Add-PSBookmark testDir " $pwd "
150+ Add-PSBookmark testDir3 " $pwd "
145151
146- " c:" | Update-PSBookmark testDir
152+ " c:" | Update-PSBookmark testDir3
147153 $_marks = Get-PSBookmarks
148154 $_marks.Count | Should - Be 1
149- $_marks.Keys | Should - Be " testDir "
155+ $_marks.Keys | Should - Be " testDir3 "
150156 $_marks.Values | Should - Be " c:"
151157 }
152158}
0 commit comments