@@ -80,15 +80,15 @@ suite('BackupMainService', () => {
8080 service . registerWindowForBackupsSync ( 1 , false , null , fooFile . fsPath ) ;
8181 service . registerWindowForBackupsSync ( 2 , false , null , barFile . fsPath ) ;
8282 service . loadSync ( ) ;
83- assert . deepEqual ( service . workspaceBackupPaths , [ ] ) ;
83+ assert . deepEqual ( service . getWorkspaceBackupPaths ( ) , [ ] ) ;
8484
8585 // 2) backup workspace path exists with empty contents within
8686 fs . mkdirSync ( service . toBackupPath ( fooFile . fsPath ) ) ;
8787 fs . mkdirSync ( service . toBackupPath ( barFile . fsPath ) ) ;
8888 service . registerWindowForBackupsSync ( 1 , false , null , fooFile . fsPath ) ;
8989 service . registerWindowForBackupsSync ( 2 , false , null , barFile . fsPath ) ;
9090 service . loadSync ( ) ;
91- assert . deepEqual ( service . workspaceBackupPaths , [ ] ) ;
91+ assert . deepEqual ( service . getWorkspaceBackupPaths ( ) , [ ] ) ;
9292 assert . ok ( ! fs . exists ( service . toBackupPath ( fooFile . fsPath ) ) ) ;
9393 assert . ok ( ! fs . exists ( service . toBackupPath ( barFile . fsPath ) ) ) ;
9494
@@ -100,7 +100,7 @@ suite('BackupMainService', () => {
100100 service . registerWindowForBackupsSync ( 1 , false , null , fooFile . fsPath ) ;
101101 service . registerWindowForBackupsSync ( 2 , false , null , barFile . fsPath ) ;
102102 service . loadSync ( ) ;
103- assert . deepEqual ( service . workspaceBackupPaths , [ ] ) ;
103+ assert . deepEqual ( service . getWorkspaceBackupPaths ( ) , [ ] ) ;
104104 assert . ok ( ! fs . exists ( service . toBackupPath ( fooFile . fsPath ) ) ) ;
105105 assert . ok ( ! fs . exists ( service . toBackupPath ( barFile . fsPath ) ) ) ;
106106
@@ -111,101 +111,101 @@ suite('BackupMainService', () => {
111111 fs . mkdirSync ( service . toBackupPath ( barFile . fsPath ) ) ;
112112 fs . mkdirSync ( fileBackups ) ;
113113 service . registerWindowForBackupsSync ( 1 , false , null , fooFile . fsPath ) ;
114- assert . equal ( service . workspaceBackupPaths . length , 1 ) ;
115- assert . equal ( service . emptyWorkspaceBackupPaths . length , 0 ) ;
114+ assert . equal ( service . getWorkspaceBackupPaths ( ) . length , 1 ) ;
115+ assert . equal ( service . getEmptyWorkspaceBackupPaths ( ) . length , 0 ) ;
116116 fs . writeFileSync ( path . join ( fileBackups , 'backup.txt' ) , '' ) ;
117117 service . loadSync ( ) ;
118- assert . equal ( service . workspaceBackupPaths . length , 0 ) ;
119- assert . equal ( service . emptyWorkspaceBackupPaths . length , 1 ) ;
118+ assert . equal ( service . getWorkspaceBackupPaths ( ) . length , 0 ) ;
119+ assert . equal ( service . getEmptyWorkspaceBackupPaths ( ) . length , 1 ) ;
120120
121121 done ( ) ;
122122 } ) ;
123123
124124 suite ( 'loadSync' , ( ) => {
125- test ( 'workspaceBackupPaths should return [] when workspaces.json doesn\'t exist' , ( ) => {
126- assert . deepEqual ( service . workspaceBackupPaths , [ ] ) ;
125+ test ( 'getWorkspaceBackupPaths() should return [] when workspaces.json doesn\'t exist' , ( ) => {
126+ assert . deepEqual ( service . getWorkspaceBackupPaths ( ) , [ ] ) ;
127127 } ) ;
128128
129- test ( 'workspaceBackupPaths should return [] when workspaces.json is not properly formed JSON' , ( ) => {
129+ test ( 'getWorkspaceBackupPaths() should return [] when workspaces.json is not properly formed JSON' , ( ) => {
130130 fs . writeFileSync ( backupWorkspacesPath , '' ) ;
131131 service . loadSync ( ) ;
132- assert . deepEqual ( service . workspaceBackupPaths , [ ] ) ;
132+ assert . deepEqual ( service . getWorkspaceBackupPaths ( ) , [ ] ) ;
133133 fs . writeFileSync ( backupWorkspacesPath , '{]' ) ;
134134 service . loadSync ( ) ;
135- assert . deepEqual ( service . workspaceBackupPaths , [ ] ) ;
135+ assert . deepEqual ( service . getWorkspaceBackupPaths ( ) , [ ] ) ;
136136 fs . writeFileSync ( backupWorkspacesPath , 'foo' ) ;
137137 service . loadSync ( ) ;
138- assert . deepEqual ( service . workspaceBackupPaths , [ ] ) ;
138+ assert . deepEqual ( service . getWorkspaceBackupPaths ( ) , [ ] ) ;
139139 } ) ;
140140
141- test ( 'workspaceBackupPaths should return [] when folderWorkspaces in workspaces.json is absent' , ( ) => {
141+ test ( 'getWorkspaceBackupPaths() should return [] when folderWorkspaces in workspaces.json is absent' , ( ) => {
142142 fs . writeFileSync ( backupWorkspacesPath , '{}' ) ;
143143 service . loadSync ( ) ;
144- assert . deepEqual ( service . workspaceBackupPaths , [ ] ) ;
144+ assert . deepEqual ( service . getWorkspaceBackupPaths ( ) , [ ] ) ;
145145 } ) ;
146146
147- test ( 'workspaceBackupPaths should return [] when folderWorkspaces in workspaces.json is not a string array' , ( ) => {
147+ test ( 'getWorkspaceBackupPaths() should return [] when folderWorkspaces in workspaces.json is not a string array' , ( ) => {
148148 fs . writeFileSync ( backupWorkspacesPath , '{"folderWorkspaces":{}}' ) ;
149149 service . loadSync ( ) ;
150- assert . deepEqual ( service . workspaceBackupPaths , [ ] ) ;
150+ assert . deepEqual ( service . getWorkspaceBackupPaths ( ) , [ ] ) ;
151151 fs . writeFileSync ( backupWorkspacesPath , '{"folderWorkspaces":{"foo": ["bar"]}}' ) ;
152152 service . loadSync ( ) ;
153- assert . deepEqual ( service . workspaceBackupPaths , [ ] ) ;
153+ assert . deepEqual ( service . getWorkspaceBackupPaths ( ) , [ ] ) ;
154154 fs . writeFileSync ( backupWorkspacesPath , '{"folderWorkspaces":{"foo": []}}' ) ;
155155 service . loadSync ( ) ;
156- assert . deepEqual ( service . workspaceBackupPaths , [ ] ) ;
156+ assert . deepEqual ( service . getWorkspaceBackupPaths ( ) , [ ] ) ;
157157 fs . writeFileSync ( backupWorkspacesPath , '{"folderWorkspaces":{"foo": "bar"}}' ) ;
158158 service . loadSync ( ) ;
159- assert . deepEqual ( service . workspaceBackupPaths , [ ] ) ;
159+ assert . deepEqual ( service . getWorkspaceBackupPaths ( ) , [ ] ) ;
160160 fs . writeFileSync ( backupWorkspacesPath , '{"folderWorkspaces":"foo"}' ) ;
161161 service . loadSync ( ) ;
162- assert . deepEqual ( service . workspaceBackupPaths , [ ] ) ;
162+ assert . deepEqual ( service . getWorkspaceBackupPaths ( ) , [ ] ) ;
163163 fs . writeFileSync ( backupWorkspacesPath , '{"folderWorkspaces":1}' ) ;
164164 service . loadSync ( ) ;
165- assert . deepEqual ( service . workspaceBackupPaths , [ ] ) ;
165+ assert . deepEqual ( service . getWorkspaceBackupPaths ( ) , [ ] ) ;
166166 } ) ;
167167
168- test ( 'emptyWorkspaceBackupPaths should return [] when workspaces.json doesn\'t exist' , ( ) => {
169- assert . deepEqual ( service . emptyWorkspaceBackupPaths , [ ] ) ;
168+ test ( 'getEmptyWorkspaceBackupPaths() should return [] when workspaces.json doesn\'t exist' , ( ) => {
169+ assert . deepEqual ( service . getEmptyWorkspaceBackupPaths ( ) , [ ] ) ;
170170 } ) ;
171171
172- test ( 'emptyWorkspaceBackupPaths should return [] when workspaces.json is not properly formed JSON' , ( ) => {
172+ test ( 'getEmptyWorkspaceBackupPaths() should return [] when workspaces.json is not properly formed JSON' , ( ) => {
173173 fs . writeFileSync ( backupWorkspacesPath , '' ) ;
174174 service . loadSync ( ) ;
175- assert . deepEqual ( service . emptyWorkspaceBackupPaths , [ ] ) ;
175+ assert . deepEqual ( service . getEmptyWorkspaceBackupPaths ( ) , [ ] ) ;
176176 fs . writeFileSync ( backupWorkspacesPath , '{]' ) ;
177177 service . loadSync ( ) ;
178- assert . deepEqual ( service . emptyWorkspaceBackupPaths , [ ] ) ;
178+ assert . deepEqual ( service . getEmptyWorkspaceBackupPaths ( ) , [ ] ) ;
179179 fs . writeFileSync ( backupWorkspacesPath , 'foo' ) ;
180180 service . loadSync ( ) ;
181- assert . deepEqual ( service . emptyWorkspaceBackupPaths , [ ] ) ;
181+ assert . deepEqual ( service . getEmptyWorkspaceBackupPaths ( ) , [ ] ) ;
182182 } ) ;
183183
184- test ( 'emptyWorkspaceBackupPaths should return [] when folderWorkspaces in workspaces.json is absent' , ( ) => {
184+ test ( 'getEmptyWorkspaceBackupPaths() should return [] when folderWorkspaces in workspaces.json is absent' , ( ) => {
185185 fs . writeFileSync ( backupWorkspacesPath , '{}' ) ;
186186 service . loadSync ( ) ;
187- assert . deepEqual ( service . emptyWorkspaceBackupPaths , [ ] ) ;
187+ assert . deepEqual ( service . getEmptyWorkspaceBackupPaths ( ) , [ ] ) ;
188188 } ) ;
189189
190- test ( 'emptyWorkspaceBackupPaths should return [] when folderWorkspaces in workspaces.json is not a string array' , ( ) => {
190+ test ( 'getEmptyWorkspaceBackupPaths() should return [] when folderWorkspaces in workspaces.json is not a string array' , ( ) => {
191191 fs . writeFileSync ( backupWorkspacesPath , '{"emptyWorkspaces":{}}' ) ;
192192 service . loadSync ( ) ;
193- assert . deepEqual ( service . emptyWorkspaceBackupPaths , [ ] ) ;
193+ assert . deepEqual ( service . getEmptyWorkspaceBackupPaths ( ) , [ ] ) ;
194194 fs . writeFileSync ( backupWorkspacesPath , '{"emptyWorkspaces":{"foo": ["bar"]}}' ) ;
195195 service . loadSync ( ) ;
196- assert . deepEqual ( service . emptyWorkspaceBackupPaths , [ ] ) ;
196+ assert . deepEqual ( service . getEmptyWorkspaceBackupPaths ( ) , [ ] ) ;
197197 fs . writeFileSync ( backupWorkspacesPath , '{"emptyWorkspaces":{"foo": []}}' ) ;
198198 service . loadSync ( ) ;
199- assert . deepEqual ( service . emptyWorkspaceBackupPaths , [ ] ) ;
199+ assert . deepEqual ( service . getEmptyWorkspaceBackupPaths ( ) , [ ] ) ;
200200 fs . writeFileSync ( backupWorkspacesPath , '{"emptyWorkspaces":{"foo": "bar"}}' ) ;
201201 service . loadSync ( ) ;
202- assert . deepEqual ( service . emptyWorkspaceBackupPaths , [ ] ) ;
202+ assert . deepEqual ( service . getEmptyWorkspaceBackupPaths ( ) , [ ] ) ;
203203 fs . writeFileSync ( backupWorkspacesPath , '{"emptyWorkspaces":"foo"}' ) ;
204204 service . loadSync ( ) ;
205- assert . deepEqual ( service . emptyWorkspaceBackupPaths , [ ] ) ;
205+ assert . deepEqual ( service . getEmptyWorkspaceBackupPaths ( ) , [ ] ) ;
206206 fs . writeFileSync ( backupWorkspacesPath , '{"emptyWorkspaces":1}' ) ;
207207 service . loadSync ( ) ;
208- assert . deepEqual ( service . emptyWorkspaceBackupPaths , [ ] ) ;
208+ assert . deepEqual ( service . getEmptyWorkspaceBackupPaths ( ) , [ ] ) ;
209209 } ) ;
210210 } ) ;
211211
@@ -232,10 +232,10 @@ suite('BackupMainService', () => {
232232 } ) ;
233233
234234 suite ( 'registerWindowForBackups' , ( ) => {
235- test ( 'pushWorkspaceBackupPathsSync should persist paths to workspaces.json' , ( ) => {
235+ test ( 'pushgetWorkspaceBackupPaths()Sync should persist paths to workspaces.json' , ( ) => {
236236 service . registerWindowForBackupsSync ( 1 , false , null , fooFile . fsPath ) ;
237237 service . registerWindowForBackupsSync ( 2 , false , null , barFile . fsPath ) ;
238- assert . deepEqual ( service . workspaceBackupPaths , [ fooFile . fsPath , barFile . fsPath ] ) ;
238+ assert . deepEqual ( service . getWorkspaceBackupPaths ( ) , [ fooFile . fsPath , barFile . fsPath ] ) ;
239239 pfs . readFile ( backupWorkspacesPath , 'utf-8' ) . then ( buffer => {
240240 const json = < IBackupWorkspacesFormat > JSON . parse ( buffer ) ;
241241 assert . deepEqual ( json . folderWorkspaces , [ fooFile . fsPath , barFile . fsPath ] ) ;
0 commit comments