'use strict';
var fs     = require('fs');
var exec   = require('child_process').exec;
var assert = require('power-assert');
var chest  = require('../lib/main');
var dummy_file_name = 'config_file';

describe('chest', function() {
  before(function() {
    if (fs.existsSync('.chest')) {
      fs.rmdirSync('.chest');
    }
  });
  it('put dummy config_file', function(done) {
    chest.put([dummy_file_name]);
    exec('ls .chest', function (err, stdout, stderr) {
      var files = stdout.split('\n');
      assert.notEqual(files.indexOf(dummy_file_name), -1);
      done();
    });
  });

  it('take dummy config_file', function(done) {
    chest.take([dummy_file_name]);
    exec('ls', function (err, stdout, stderr) {
      var files = stdout.split('\n');
      assert.notEqual(files.indexOf(dummy_file_name), -1);
      done();
    });
  });
  after(function() {
    if (fs.existsSync('.chest')) {
      fs.rmdirSync('.chest');
    }
  });
});

@@ -353,36 +353,32 @@
 file', function(
-done
 ) %7B%0A    chest.pu
@@ -407,99 +407,205 @@
     
-exec('ls .chest', function (err, stdout, stderr) %7B%0A      var files = stdout.split('%5Cn
+var files = fs.readdirSync('./.chest');%0A    assert.notEqual(files.indexOf(dummy_file_name), -1);%0A  %7D);%0A  it('open config_file', function() %7B%0A    chest.open();%0A    var files = fs.readdirSync('./
 ');%0A
-  
     
@@ -659,33 +659,167 @@
  -1);%0A  
-    done();%0A    %7D
+%7D);%0A  it('close config_file', function() %7B%0A    chest.close();%0A    var files = fs.readdirSync('./');%0A    assert.equal(files.indexOf(dummy_file_name), -1
 );%0A  %7D);
@@ -819,17 +819,16 @@
 ;%0A  %7D);%0A
-%0A
   it('ta
@@ -859,20 +859,16 @@
 unction(
-done
 ) %7B%0A    
@@ -906,92 +906,42 @@
     
-exec('ls', function (err, stdout, stderr) %7B%0A      var files = stdout.split('%5Cn
+var files = fs.readdirSync('./
 ');%0A
-  
     
@@ -997,30 +997,8 @@
 1);%0A
-      done();%0A    %7D);%0A
   %7D)

Add test open and close