2015-03-08 15:56:21 +00:00
|
|
|
var chai = require('chai');
|
2015-03-08 17:18:52 +00:00
|
|
|
var utils = require('../lib/utils/utils.js');
|
2015-03-08 15:56:21 +00:00
|
|
|
var assert = chai.assert;
|
|
|
|
|
|
|
|
var tests = [
|
|
|
|
{ value: function () {}, is: false},
|
|
|
|
{ value: new Function(), is: false},
|
|
|
|
{ value: 'function', is: false},
|
|
|
|
{ value: {}, is: false},
|
|
|
|
{ value: '0xc6d9d2cd449a754c494264e1809c50e34d64562b', is: true },
|
2015-04-09 21:30:18 +00:00
|
|
|
{ value: 'c6d9d2cd449a754c494264e1809c50e34d64562b', is: true }
|
2015-03-08 15:56:21 +00:00
|
|
|
];
|
|
|
|
|
2015-03-25 21:17:35 +00:00
|
|
|
describe('lib/utils/utils', function () {
|
2015-03-08 15:56:21 +00:00
|
|
|
describe('isAddress', function () {
|
|
|
|
tests.forEach(function (test) {
|
|
|
|
it('shoud test if value ' + test.value + ' is address: ' + test.is, function () {
|
|
|
|
assert.equal(utils.isAddress(test.value), test.is);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|