forked from stephenmathieson-boneyard/node-cpplint
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathout.js
41 lines (31 loc) · 720 Bytes
/
out.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
var vows = require('vows');
var assert = require('assert');
var out = require('../lib/out');
var suite = vows.describe('out');
suite.addBatch({
'when calling `out()`': {
topic: this.callback,
'an exception should be thrown': function () {
'use strict';
assert.throws(function () {
out();
});
}
},
'providing a custom stream': {
topic: this.callback,
'should pass the `str` along': function () {
'use strict';
var expected = 'cats',
stream = {
write: function (actual) {
assert.equal(actual, expected);
}
};
out(expected, {
stream: stream
});
}
}
});
suite.export(module);