filer/tests/spec/fs.spec.js

42 lines
841 B
JavaScript
Raw Normal View History

define(["Filer"], function(Filer) {
2013-11-27 17:18:09 +00:00
describe("fs", function() {
beforeEach(function() {
this.db_name = mk_db_name();
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();
});
});
});
});