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

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


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

      this.webapp = helpers.createGenerator('bookmarklet:app', [
        '../../app'
      ]);
      this.webapp.options['skip-install'] = true;
      done();
    }.bind(this));
  });

  it('creates expected files', function (done) {
    var expected = [
      ['package.json', /"name": "temp"/],
      '.gitignore',
      '.gitattributes',
      '.jshintrc',
      'gulpfile.js',
      'app/main.js'
    ];

    this.webapp.run({}, function () {
      helpers.assertFiles(expected);
      done();
    });
  });
});

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

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


describe('Bookmarklet generator', function () {
  beforeEach(function (done) {
    helpers.run(path.join(__dirname, '../app'))
      .withOptions({ skipInstall: true })
      .on('end', done);
  });

  it('creates expected files', function () {
    var expected = [
      'package.json',
      '.gitignore',
      '.gitattributes',
      '.jshintrc',
      'gulpfile.js',
      'app/main.js'
    ];

    assert.file(expected);
  });
});

Fix tests with new helpers.run call
Fix tests with new helpers.run call
