From a761db5ba23809eb2b1410753bf4841e96d6aa24 Mon Sep 17 00:00:00 2001 From: Manuel Araoz Date: Wed, 16 Apr 2014 12:41:13 -0300 Subject: [PATCH] fix bind usage in some tests --- test/test.PublicKeyRing.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/test/test.PublicKeyRing.js b/test/test.PublicKeyRing.js index ac29a9647..b10338b94 100644 --- a/test/test.PublicKeyRing.js +++ b/test/test.PublicKeyRing.js @@ -56,7 +56,7 @@ describe('PublicKeyRing model', function() { w2.registeredCopayers().should.equal(0); w2.isComplete().should.equal(false); - w2.getAddress.bind(false).should.throw(); + (function() {w2.getAddress(0, false);}).should.throw(); }); it('should add and check when adding shared pub keys', function () { @@ -65,9 +65,10 @@ describe('PublicKeyRing model', function() { var copayers = k.copayers; w.isComplete().should.equal(true); - w.addCopayer.bind().should.throw(); - for(var i =0; i<5; i++) - w.addCopayer.bind(copayers[i]).should.throw(); + w.addCopayer.should.throw(); + for(var i =0; i<5; i++) { + (function() {w.addCopayer(copayers[i])}).should.throw(); + } }); it('show be able to tostore and read', function () { @@ -85,9 +86,10 @@ describe('PublicKeyRing model', function() { var w2 = PublicKeyRing.fromObj(data); w2.walletId.should.equal(w.walletId); w2.isComplete().should.equal(true); - w2.addCopayer.bind().should.throw(); - for(var i =0; i<5; i++) - w2.addCopayer.bind(copayers[i]).should.throw(); + w2.addCopayer.should.throw(); + for(var i =0; i<5; i++) { + (function() {w.addCopayer(copayers[i])}).should.throw(); + } w2.changeAddressIndex.should.equal(3); w2.addressIndex.should.equal(5);