const postgresql = require('../');
const expect = require('chai').expect;
const rimraf = require('rimraf');

rimraf.sync('./tmp');

describe('init', function () {
  this.timeout(5000);
  it('should refuse to init a directory that is not empty', function () {
    expect(function() {
      postgresql.initdb('./');
    }).to.throw;
  });

  it('should init a database directory', function (done) {
    postgresql.initdb('./tmp', function () {
      done();
    });
  });
});
