var fs = require('fs');
var expect = require('chai').expect;
var fse = require('fs-extra');

var commands = require('../dist/commands');

function checkFileOrDirExists(path) {
  try {
    fs.lstatSync(path);
  } catch (e) {
    if (e.code === 'ENOENT') {
      return false;
    }

    throw e;
  }

  return true;
}

describe("create", function() {
  beforeEach(function() {
    fse.mkdirsSync('./tmp');
    process.chdir('./tmp');
  });

  afterEach(function() {
    fse.removeSync('./blog');
    process.chdir('../');
  });

  it("creates a skeleton mantra app", function() {
    commands.create('blog');
    expect(checkFileOrDirExists('./blog')).to.equal(true);
    expect(checkFileOrDirExists('./blog/client/configs/context.js')).to.equal(true);
    expect(checkFileOrDirExists('./blog/client/modules/core/actions/index.js')).to.equal(true);
    expect(checkFileOrDirExists('./blog/client/modules/core/components/main_layout.jsx')).to.equal(true);
    expect(checkFileOrDirExists('./blog/client/modules/core/index.js')).to.equal(true);
    expect(checkFileOrDirExists('./blog/client/modules/core/routes.jsx')).to.equal(true);
    expect(checkFileOrDirExists('./blog/client/modules/main.js')).to.equal(true);
    expect(checkFileOrDirExists('./blog/lib/collections/index.js')).to.equal(true);
    expect(checkFileOrDirExists('./blog/server/publications/index.js')).to.equal(true);
    expect(checkFileOrDirExists('./blog/server/methods/index.js')).to.equal(true);
    expect(checkFileOrDirExists('./blog/server/configs/')).to.equal(true);
    expect(checkFileOrDirExists('./blog/server/main.js')).to.equal(true);
  });
});

@@ -311,16 +311,167 @@
 rue;%0A%7D%0A%0A
+var consoleLog = console.log;%0A%0Afunction suppressStdOut() %7B%0A  console.log = function() %7B%7D;%0A%7D%0A%0Afunction restoreStdOut() %7B%0A  console.log = consoleLog;%0A%7D%0A%0A
 describe
@@ -719,24 +719,46 @@
 unction() %7B%0A
+    suppressStdOut();%0A
     commands
@@ -770,24 +770,45 @@
 te('blog');%0A
+    restoreStdOut();%0A
     expect(c

Clean up test by suppressing console output