|
|
@ -9,7 +9,26 @@ var Wallet = require('../../lib/model/wallet'); |
|
|
|
|
|
|
|
describe('Wallet', function() { |
|
|
|
|
|
|
|
describe('#create', function() { |
|
|
|
it('will throw with an invalid string argument for "m" or "n"', function() { |
|
|
|
(function() { |
|
|
|
Wallet.create({m: '2', n: 2}); |
|
|
|
}).should.throw('"m" is expected to be a number'); |
|
|
|
(function() { |
|
|
|
Wallet.create({m: 2, n: '2'}); |
|
|
|
}).should.throw('"n" is expected to be a number'); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
describe('#fromObj', function() { |
|
|
|
it('will throw with an invalid string argument for "m" or "n"', function() { |
|
|
|
(function() { |
|
|
|
Wallet.fromObj({m: '2', n: 2}); |
|
|
|
}).should.throw('"m" is expected to be a number'); |
|
|
|
(function() { |
|
|
|
Wallet.fromObj({m: 2, n: '2'}); |
|
|
|
}).should.throw('"n" is expected to be a number'); |
|
|
|
}); |
|
|
|
it('read a wallet', function() { |
|
|
|
var w = Wallet.fromObj(testWallet); |
|
|
|
w.isComplete().should.be.true; |
|
|
|