Reset Realm.defaultPath in testDefaultPath
Or else the rest of the tests use the new default path!
This commit is contained in:
parent
c7e156a7b8
commit
2384cc4036
|
@ -145,14 +145,19 @@ module.exports = {
|
||||||
},
|
},
|
||||||
|
|
||||||
testDefaultPath: function() {
|
testDefaultPath: function() {
|
||||||
|
var defaultPath = Realm.defaultPath;
|
||||||
var defaultRealm = new Realm({schema: []});
|
var defaultRealm = new Realm({schema: []});
|
||||||
TestCase.assertEqual(defaultRealm.path, Realm.defaultPath);
|
TestCase.assertEqual(defaultRealm.path, Realm.defaultPath);
|
||||||
|
|
||||||
var newPath = Realm.defaultPath.substring(0, Realm.defaultPath.lastIndexOf("/") + 1) + 'default2.realm';
|
try {
|
||||||
Realm.defaultPath = newPath;
|
var newPath = Realm.defaultPath.substring(0, defaultPath.lastIndexOf('/') + 1) + 'default2.realm';
|
||||||
defaultRealm = new Realm({schema: []});
|
Realm.defaultPath = newPath;
|
||||||
TestCase.assertEqual(defaultRealm.path, newPath, "should use updated default realm path");
|
defaultRealm = new Realm({schema: []});
|
||||||
TestCase.assertEqual(Realm.defaultPath, newPath, "defaultPath should have been updated");
|
TestCase.assertEqual(defaultRealm.path, newPath, "should use updated default realm path");
|
||||||
|
TestCase.assertEqual(Realm.defaultPath, newPath, "defaultPath should have been updated");
|
||||||
|
} finally {
|
||||||
|
Realm.defaultPath = defaultPath;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
testRealmSchemaVersion: function() {
|
testRealmSchemaVersion: function() {
|
||||||
|
|
Loading…
Reference in New Issue