Skip to content

Commit

Permalink
Merge pull request #677 from ernestas2k/fix/error-testing-in-delayed-…
Browse files Browse the repository at this point in the history
…claimable#672

Fix error testing in DelayClaimable tests
  • Loading branch information
frangio authored Jan 15, 2018
2 parents 73a8be1 + c9fff64 commit 7532dab
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions test/DelayedClaimble.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@

import assertRevert from './helpers/assertRevert';

var DelayedClaimable = artifacts.require('../contracts/ownership/DelayedClaimable.sol');

contract('DelayedClaimable', function (accounts) {
Expand Down Expand Up @@ -42,25 +44,13 @@ contract('DelayedClaimable', function (accounts) {
assert.equal(start, 100);
let pendingOwner = await delayedClaimable.pendingOwner();
assert.equal(pendingOwner, accounts[1]);
var err = null;
try {
await delayedClaimable.claimOwnership({ from: accounts[1] });
} catch (error) {
err = error;
}
assert.isFalse(err.message.search('revert') === -1);
await assertRevert(delayedClaimable.claimOwnership({ from: accounts[1] }));
let owner = await delayedClaimable.owner();
assert.isTrue(owner !== accounts[1]);
});

it('set end and start invalid values fail', async function () {
await delayedClaimable.transferOwnership(accounts[1]);
var err = null;
try {
await delayedClaimable.setLimits(1001, 1000);
} catch (error) {
err = error;
}
assert.isFalse(err.message.search('revert') === -1);
await assertRevert(delayedClaimable.setLimits(1001, 1000));
});
});

0 comments on commit 7532dab

Please sign in to comment.