refactor testing error throwing

This commit is contained in:
Jakub Wojciechowski
2017-07-22 21:40:01 +01:00
parent 5e7847537a
commit b3f60b9320
10 changed files with 79 additions and 78 deletions

View File

@ -25,11 +25,11 @@ contract('Claimable', function(accounts) {
it('should prevent to claimOwnership from no pendingOwner', async function() {
try {
await claimable.claimOwnership({from: accounts[2]});
await claimable.claimOwnership({from: accounts[2]});
assert.fail('should have thrown before');
} catch(error) {
return assertJump(error);
assertJump(error);
}
assert.fail('should have thrown before');
});
it('should prevent non-owners from transfering', async function() {
@ -37,11 +37,11 @@ contract('Claimable', function(accounts) {
const owner = await claimable.owner.call();
assert.isTrue(owner !== other);
try {
await claimable.transferOwnership(other, {from: other});
await claimable.transferOwnership(other, {from: other});
assert.fail('should have thrown before');
} catch(error) {
return assertJump(error);
assertJump(error);
}
assert.fail('should have thrown before');
});
describe('after initiating a transfer', function () {