/*global describe, beforeEach, it*/
'use strict';

var path    = require('path');
var helpers = require('yeoman-generator').test;


describe('vinelab generator', function () {
    beforeEach(function (done) {
        helpers.testDirectory(path.join(__dirname, 'temp'), function (err) {
            if (err) {
                return done(err);
            }

            this.app = helpers.createGenerator('vinelab:app', [
                '../../app'
            ]);
            done();
        }.bind(this));
    });

    it('creates expected files', function (done) {
        var expected = [
            // add files you expect to exist here.
            '.jshintrc',
            '.editorconfig'
        ];

        helpers.mockPrompt(this.app, {
            'someOption': true
        });
        this.app.options['skip-install'] = true;
        this.app.run({}, function () {
            helpers.assertFiles(expected);
            done();
        });
    });
});

@@ -123,16 +123,57 @@
 ).test;%0A
+var exec = require('child_process').exec;
 %0A%0Adescri
@@ -177,21 +177,17 @@
 cribe('v
-inela
+l
 b genera
@@ -441,13 +441,9 @@
 r('v
-inela
+l
 b:ap
@@ -688,46 +688,950 @@
    '
-.jshintrc',%0A            '.editorconfig
+app/bootstrap.coffee',%0A            'app/views/main.html',%0A            'app/config/default.yml',%0A            'app/config/development.yml',%0A            'app/config/production.yml',%0A            'app/assets/styles/base.less',%0A            'app/src/App.coffee',%0A            'app/src/Config/Config.coffee',%0A            'app/src/Main/controllers/MainController.coffee',%0A            'app/src/Storage/StorageService.coffee',%0A            'app/src/Socket/io.coffee',%0A            'app/src/Socket/Socket.coffee',%0A            '.bowerrc', 'Gruntfile.coffee', '.gitignore', 'index.html',%0A            'tests/unit/config/karma.conf.coffee',%0A            'tests/unit/Socket/SocketTest.coffee',%0A            'tests/unit/Main/controllers/MainControllerTest.coffee',%0A            'tests/e2e/config/e2e.chrome.js', 'tests/e2e/config/e2e.firefox.js',%0A            'tests/e2e/config/e2e.phantom.js', 'tests/e2e/config/e2e.safari.js',%0A            'tests/e2e/mainTest.coffee
 '%0A  
@@ -1690,16 +1690,19 @@
         
+ //
  'someOp
@@ -1860,37 +1860,199 @@
 d);%0A            
-done(
+exec('rm -rf ' + path.join(__dirname, 'temp'), function (err, out) %7B%0A                console.log(out); err && console.error(err);%0A                done();%0A            %7D
 );%0A        %7D);%0A 

add app creation tests