Skip to content

Commit 2020778

Browse files
authored
Add open / close for sharedcache database
1 parent a5fbefd commit 2020778

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

test/open_close.test.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,29 @@ describe('open/close', function() {
3030
helper.deleteFile('test/tmp/test_create.db');
3131
});
3232
});
33+
34+
describe('open and close non-existant shared database', function() {
35+
before(function() {
36+
helper.deleteFile('test/tmp/test_create_shared.db');
37+
});
38+
39+
var db;
40+
it('should open the database', function(done) {
41+
db = new sqlite3.Database('test/tmp/test_create_shared.db',sqlite3.OPEN_SHAREDCACHE|sqlite3.SQLITE_OPEN_MEMORY, done);
42+
});
43+
44+
it('should close the database', function(done) {
45+
db.close(done);
46+
});
47+
48+
it('should have created the file', function() {
49+
assert.fileExists('test/tmp/test_create_shared.db');
50+
});
51+
52+
after(function() {
53+
helper.deleteFile('test/tmp/test_create_shared.db');
54+
});
55+
});
3356

3457
it('should not be unable to open an inaccessible database', function(done) {
3558
// NOTE: test assumes that the user is not allowed to create new files

0 commit comments

Comments
 (0)