@@ -30,7 +30,8 @@ suite('settings.js', function() {
30
30
GAIA_DISTRIBUTION_DIR : 'testDistributionDir' ,
31
31
GAIA_DIR : 'testGaia' ,
32
32
SETTINGS_PATH : 'testSettingsPath' ,
33
- STAGE_DIR : 'testStageDir'
33
+ STAGE_DIR : 'testStageDir' ,
34
+ PROFILE_DIR : 'testProfileDir'
34
35
} ;
35
36
mockUtils . resolve = function ( file , baseLink ) {
36
37
var fileExist = false ;
@@ -185,21 +186,22 @@ suite('settings.js', function() {
185
186
} ) ;
186
187
187
188
test ( 'writeSettings' , function ( ) {
188
- var settingsFile = { result : '' } ;
189
+ var settingsFile = { result : '' } ;
189
190
var settings = { 'testKey' : 'testValue' } ;
190
- mockUtils . getFile = function ( dir , file ) {
191
+ mockUtils . getFile = function ( ) {
192
+ var args = Array . prototype . slice . call ( arguments ) ;
191
193
return {
192
- path : dir + '/' + file
194
+ path : args . join ( '/' ) ,
195
+ append : function ( ) { }
193
196
} ;
194
197
} ;
195
198
mockUtils . writeContent = function ( target , string ) {
196
- if ( target . path === config . STAGE_DIR + '/settings_stage .json' ) {
199
+ if ( target . path === config . PROFILE_DIR + '/settings .json' ) {
197
200
settingsFile . result = string ;
198
201
}
199
202
} ;
200
203
app . writeSettings ( settings , config ) ;
201
- assert . deepEqual ( JSON . parse ( settingsFile . result ) ,
202
- settings ) ;
204
+ assert . deepEqual ( JSON . parse ( settingsFile . result ) , settings ) ;
203
205
} ) ;
204
206
205
207
test ( 'setHomescreenURL with default homescreen' , function ( ) {
@@ -247,7 +249,8 @@ suite('settings.js', function() {
247
249
return {
248
250
exists : function ( ) {
249
251
return true ;
250
- }
252
+ } ,
253
+ append : function ( ) { }
251
254
} ;
252
255
} ;
253
256
mockUtils . getJSON = function ( json ) {
0 commit comments