|
1 | 1 |
|
2 | | -var expect = require('expect.js') |
3 | | - , utils = require('../lib/utils') |
| 2 | +var expect = require('expect.js'); |
| 3 | +var utils = require('../lib/utils'); |
4 | 4 |
|
5 | 5 | describe('utils', function () { |
6 | 6 | describe('exitError', function () { |
7 | 7 | it('should return a subclass of error', function () { |
8 | | - expect(utils.exitError('ls', 27)).to.be.an(Error) |
9 | | - }) |
| 8 | + expect(utils.exitError('ls', 27)).to.be.an(Error); |
| 9 | + }); |
10 | 10 | it('should have a "code" attribute indicating the exit code', function () { |
11 | | - expect(utils.exitError('ls', 27).code).to.equal(27) |
12 | | - }) |
13 | | - }) |
| 11 | + expect(utils.exitError('ls', 27).code).to.equal(27); |
| 12 | + }); |
| 13 | + }); |
14 | 14 |
|
15 | 15 | describe('sum', function () { |
16 | 16 | it('should calculate correctly', function () { |
17 | | - expect(utils.sum([12,3,4])).to.equal(19) |
18 | | - }) |
19 | | - }) |
| 17 | + expect(utils.sum([12,3,4])).to.equal(19); |
| 18 | + }); |
| 19 | + }); |
20 | 20 |
|
21 | 21 | describe('runPlugin', function () { |
22 | 22 | describe('with no action for that phase', function () { |
23 | | - var plugin = {} |
| 23 | + var plugin = {}; |
24 | 24 | it('should noop', function (done) { |
25 | | - utils.runPlugin('test', plugin, {}, done) |
26 | | - }) |
27 | | - }) |
| 25 | + utils.runPlugin('test', plugin, {}, done); |
| 26 | + }); |
| 27 | + }); |
28 | 28 | describe('with a string action', function () { |
29 | 29 | it('should call context.cmd', function (done) { |
30 | 30 | utils.runPlugin('test', {'test': 'ls'}, { |
31 | 31 | cmd: function (text) { |
32 | | - expect(text).to.equal('ls') |
33 | | - done() |
| 32 | + expect(text).to.equal('ls'); |
| 33 | + done(); |
34 | 34 | } |
35 | | - }, null) |
36 | | - }) |
37 | | - }) |
| 35 | + }, null); |
| 36 | + }); |
| 37 | + }); |
38 | 38 | describe('with an executable action', function () { |
39 | 39 | it('should call the action', function (done) { |
40 | 40 | utils.runPlugin('test', { |
41 | | - test: function () {done()} |
42 | | - }, {}, null) |
43 | | - }) |
44 | | - }) |
45 | | - }) |
| 41 | + test: function () { |
| 42 | + done(); |
| 43 | + } |
| 44 | + }, {}, null); |
| 45 | + }); |
| 46 | + }); |
| 47 | + }); |
46 | 48 |
|
47 | 49 | describe('normalizeCmd', function () { |
48 | 50 | it('should process a string', function () { |
49 | | - var cmd = utils.normalizeCmd('ls -l -a') |
50 | | - expect(cmd.command).to.equal('ls') |
51 | | - expect(cmd.args).to.eql(['-l', '-a']) |
52 | | - }) |
| 51 | + var cmd = utils.normalizeCmd('ls -l -a'); |
| 52 | + expect(cmd.command).to.equal('ls'); |
| 53 | + expect(cmd.args).to.eql(['-l', '-a']); |
| 54 | + }); |
53 | 55 |
|
54 | 56 | it('should process a command and args', function () { |
55 | | - var cmd = utils.normalizeCmd({command: 'ls', args: ['-a']}) |
56 | | - expect(cmd.command).to.equal('ls') |
57 | | - expect(cmd.args).to.eql(['-a']) |
58 | | - }) |
59 | | - }) |
60 | | -}) |
| 57 | + var cmd = utils.normalizeCmd({command: 'ls', args: ['-a']}); |
| 58 | + expect(cmd.command).to.equal('ls'); |
| 59 | + expect(cmd.args).to.eql(['-a']); |
| 60 | + }); |
| 61 | + }); |
| 62 | +}); |
61 | 63 |
|
0 commit comments