mirror of
https://github.com/zebrajr/express.git
synced 2026-01-15 12:15:27 +00:00
25 lines
611 B
JavaScript
25 lines
611 B
JavaScript
|
|
|
|
var utils = require('../lib/utils')
|
|
, assert = require('assert');
|
|
|
|
describe('utils.isAbsolute()', function(){
|
|
it('should support windows', function(){
|
|
assert(utils.isAbsolute('c:\\'));
|
|
assert(!utils.isAbsolute(':\\'));
|
|
})
|
|
|
|
it('should unices', function(){
|
|
assert(utils.isAbsolute('/foo/bar'));
|
|
assert(!utils.isAbsolute('foo/bar'));
|
|
})
|
|
})
|
|
|
|
describe('utils.flatten(arr)', function(){
|
|
it('should flatten an array', function(){
|
|
var arr = ['one', ['two', ['three', 'four'], 'five']];
|
|
utils
|
|
.flatten(arr)
|
|
.should.eql(['one', 'two', 'three', 'four', 'five']);
|
|
})
|
|
}) |