2014-01-14 15:56:36 +00:00
|
|
|
define(["Filer"], function(Filer) {
|
2013-11-27 17:18:09 +00:00
|
|
|
|
|
|
|
describe("fs", function() {
|
|
|
|
beforeEach(function() {
|
|
|
|
this.db_name = mk_db_name();
|
2014-01-14 15:56:36 +00:00
|
|
|
this.fs = new Filer.FileSystem({
|
2013-11-27 17:18:09 +00:00
|
|
|
name: this.db_name,
|
|
|
|
flags: 'FORMAT'
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
afterEach(function() {
|
|
|
|
indexedDB.deleteDatabase(this.db_name);
|
|
|
|
delete this.fs;
|
|
|
|
});
|
|
|
|
|
|
|
|
it("is an object", function() {
|
|
|
|
expect(typeof this.fs).toEqual('object');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should have a root directory', function() {
|
|
|
|
var complete = false;
|
|
|
|
var _result;
|
|
|
|
|
|
|
|
this.fs.stat('/', function(error, result) {
|
|
|
|
_result = result;
|
|
|
|
|
|
|
|
complete = true;
|
|
|
|
});
|
|
|
|
|
|
|
|
waitsFor(function() {
|
|
|
|
return complete;
|
|
|
|
}, 'test to complete', DEFAULT_TIMEOUT);
|
|
|
|
|
|
|
|
runs(function() {
|
|
|
|
expect(_result).toBeDefined();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|