tests: if description undefined, use exception

This commit is contained in:
Daniel Cousens 2015-02-04 20:29:58 +11:00
parent 1fde0a401d
commit 5f761113cc
2 changed files with 3 additions and 3 deletions

View file

@ -65,8 +65,8 @@ function isPubKeyOutput(script) {
function isScriptHashInput(script, allowIncomplete) { function isScriptHashInput(script, allowIncomplete) {
if (script.chunks.length < 2) return false if (script.chunks.length < 2) return false
var lastChunk = script.chunks[script.chunks.length - 1]
var lastChunk = script.chunks[script.chunks.length - 1]
if (!Buffer.isBuffer(lastChunk)) return false if (!Buffer.isBuffer(lastChunk)) return false
var scriptSig = Script.fromChunks(script.chunks.slice(0, -1)) var scriptSig = Script.fromChunks(script.chunks.slice(0, -1))

View file

@ -164,7 +164,7 @@ describe('TransactionBuilder', function() {
}) })
fixtures.invalid.build.forEach(function(f) { fixtures.invalid.build.forEach(function(f) {
describe('for ' + f.description, function() { describe('for ' + (f.description || f.exception), function() {
beforeEach(function() { beforeEach(function() {
if (f.txHex) { if (f.txHex) {
var tx = Transaction.fromHex(f.txHex) var tx = Transaction.fromHex(f.txHex)
@ -175,7 +175,7 @@ describe('TransactionBuilder', function() {
} }
}) })
it('throws on ' + f.exception, function() { it('throws', function() {
assert.throws(function() { assert.throws(function() {
txb.build() txb.build()
}, new RegExp(f.exception)) }, new RegExp(f.exception))