var level = require('level-test')({ valueEncoding: 'json' })
  , levelVinyl = require('../../')
  , sub = require('level-sublevel')
  , path = require('path')
  , tmpdir = require('osenv').tmpdir()
  , mkdirp = require('mkdirp')

module.exports = function() {
  var prefix = 'level-vinyl-tests/' + Date.now()
  mkdirp.sync(path.join(tmpdir, prefix))

  var blobs = path.join(tmpdir, prefix, 'vinyl-blobs');
  var sdb = sub(level(prefix+'/db'), { valueEncoding: 'json'});
  return levelVinyl(sdb, blobs)
}

@@ -226,44 +226,11 @@
 p')%0A
-%0Amodule.exports = function() %7B%0A  var
+  ,
  pre
@@ -275,53 +275,9 @@
 )%0A  
-mkdirp.sync(path.join(tmpdir, prefix))%0A%0A  var
+,
  blo
@@ -325,26 +325,40 @@
 bs')
-;%0A  
+%0A%0Amkdirp.sync(blobs)%0A%0A
 var 
-s
+l
 db = 
-sub(
 leve
@@ -372,16 +372,34 @@
 x+'/db')
+%0A  , sdb = sub(ldb
 , %7B valu
@@ -419,20 +419,21 @@
 son'
+ 
 %7D)
-;
 %0A  
-return
+, vdb =
  lev
@@ -452,10 +452,87 @@
  blobs)%0A
+  , n   = 1%0A%0Amodule.exports = function() %7B%0A  return vdb.subvinyl( '' + n++ )%0A
 %7D%0A

use one db for tests