|
1 | 1 | /*global describe, before, beforeEach, it */
|
2 | 2 | 'use strict';
|
3 |
| -var path = require('path'); |
4 |
| -var os = require('os'); |
5 | 3 | var events = require('events');
|
6 | 4 | var Environment = require('yeoman-environment');
|
7 | 5 | var generators = require('../');
|
8 | 6 | var assert = require('yeoman-assert');
|
9 |
| -var helpers = require('yeoman-test'); |
10 |
| -var tmpdir = path.join(os.tmpdir(), 'yeoman-generators'); |
11 | 7 |
|
12 | 8 | describe('Generators module', function () {
|
13 |
| - before(helpers.setUpTestDirectory(tmpdir)); |
14 |
| - |
15 |
| - describe('module', function () { |
16 |
| - it('initialize new Environments', function () { |
17 |
| - assert.ok(generators() instanceof Environment); |
18 |
| - assert.notEqual(generators(), generators()); |
19 |
| - }); |
20 |
| - |
21 |
| - it('pass arguments to the Environment constructor', function () { |
22 |
| - var args = ['model', 'Post']; |
23 |
| - var opts = { help: true }; |
24 |
| - var env = generators(args, opts); |
25 |
| - assert.deepEqual(env.arguments, args); |
26 |
| - assert.deepEqual(env.options, opts); |
27 |
| - }); |
28 |
| - }); |
29 |
| - |
30 | 9 | describe('generators.Base', function () {
|
31 | 10 | beforeEach(function () {
|
32 |
| - this.env = generators(); |
| 11 | + this.env = Environment.createEnv(); |
33 | 12 | this.generator = new generators.Base({
|
34 | 13 | env: this.env,
|
35 | 14 | resolved: 'test'
|
|
0 commit comments