Comparing version 3.0.2 to 3.0.3
@@ -84,3 +84,3 @@ var raf = require('random-access-file') | ||
self._feeds = [] | ||
self.fake = undefined | ||
self._fake = undefined | ||
return done() | ||
@@ -117,3 +117,6 @@ } | ||
} | ||
next(n+1) | ||
st.close(function (err) { | ||
if (err) return cb(err) | ||
next(n+1) | ||
}) | ||
}) | ||
@@ -120,0 +123,0 @@ }) |
@@ -5,3 +5,3 @@ { | ||
"author": "Stephen Whitmore <sww@eight.net>", | ||
"version": "3.0.2", | ||
"version": "3.0.3", | ||
"repository": { | ||
@@ -8,0 +8,0 @@ "url": "git://github.com/noffle/multifeed.git" |
@@ -211,1 +211,27 @@ var test = require('tape') | ||
}) | ||
test('close after double-open', function (t) { | ||
var storage = tmp() | ||
openWriteClose(function (err) { | ||
t.error(err) | ||
openWriteClose(function (err) { | ||
t.error(err) | ||
rimraf(storage, function (err) { | ||
t.error(err, 'Deleted folder without error') | ||
t.end() | ||
}) | ||
}) | ||
}) | ||
function openWriteClose (cb) { | ||
var multi = multifeed(hypercore, storage, { valueEncoding: 'json' }) | ||
multi.writer('minuette', function (err, w) { | ||
t.error(err) | ||
w.append({type: 'node'}, function (err) { | ||
t.error(err) | ||
multi.close(cb) | ||
}) | ||
}) | ||
} | ||
}) |
36650
990