cleanup throw tests, add case for bad input

This commit is contained in:
Kyle Drake 2014-03-06 17:27:40 -06:00
parent fdc78dad2e
commit 09925cff5a
No known key found for this signature in database
GPG key ID: 8BE721072E1864BE

View file

@ -31,13 +31,9 @@ describe('Address', function() {
}) })
it('throws error for invalid or unrecognized input', function() { it('throws error for invalid or unrecognized input', function() {
var addr = assert.throws(function() {
assert.throws( new Address('beepboopbeepboopbeepboopbeepboopbeepboopbeep')
function() { }, Error)
new Address('beepboopbeepboopbeepboopbeepboopbeepboopbeep')
},
Error
)
}) })
it('works for byte input', function() { it('works for byte input', function() {
@ -51,6 +47,12 @@ describe('Address', function() {
assert.equal(addr.hash, hash) assert.equal(addr.hash, hash)
assert.equal(network.testnet.addressVersion, hash.version) assert.equal(network.testnet.addressVersion, hash.version)
}) })
it('fails for bad input', function() {
assert.throws(function() {
new Address('foo')
}, Error)
})
}) })
describe('getVersion', function() { describe('getVersion', function() {