1 | 'use strict';
|
2 |
|
3 | var when = require('when'),
|
4 | sinon = require('sinon'),
|
5 | should = require('should'),
|
6 | utility = require('./../lib/utility');
|
7 |
|
8 | describe('utility tests', function () {
|
9 |
|
10 | describe('#warn()', function () {
|
11 |
|
12 | beforeEach(function () {
|
13 | this.consoleWrap = new utility.wrappedConsole;
|
14 | })
|
15 |
|
16 | it ('should prefix console.warn', function () {
|
17 | this.consoleWrap.setWarnPrefix('akamai: WARNING:');
|
18 |
|
19 | var warnstub = sinon.stub(console, 'warn');
|
20 |
|
21 | this.consoleWrap.warn('Test warning');
|
22 |
|
23 | sinon.assert.calledWith(warnstub, 'akamai: WARNING: Test warning');
|
24 | warnstub.callCount.should.equal(1);
|
25 | });
|
26 |
|
27 | });
|
28 |
|
29 | });
|