From b40a01e97bc245c48c3b256149f5a379e3761532 Mon Sep 17 00:00:00 2001 From: Rudy Godoy Date: Thu, 29 Jun 2017 13:12:58 -0500 Subject: [PATCH] Small refactoring to not DRY --- test/TokenDestructible.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/TokenDestructible.js b/test/TokenDestructible.js index 1f943e3df..7ba052e21 100644 --- a/test/TokenDestructible.js +++ b/test/TokenDestructible.js @@ -5,9 +5,13 @@ var StandardTokenMock = artifacts.require("./helpers/StandardTokenMock.sol"); require('./helpers/transactionMined.js'); contract('TokenDestructible', function(accounts) { + let destructible; + beforeEach(async function() { + destructible = await TokenDestructible.new({fron: accounts[0], value: web3.toWei('10', 'ether')}); + }); + it('should send balance to owner after destruction', async function() { - let destructible = await TokenDestructible.new({from: accounts[0], value: web3.toWei('10','ether')}); let owner = await destructible.owner(); let initBalance = web3.eth.getBalance(owner); await destructible.destroy([], {from: owner}); @@ -16,7 +20,6 @@ contract('TokenDestructible', function(accounts) { }); it('should send tokens to owner after destruction', async function() { - let destructible = await TokenDestructible.new({from: accounts[0], value: web3.toWei('10','ether')}); let owner = await destructible.owner(); let token = await StandardTokenMock.new(destructible.address, 100); let initContractBalance = await token.balanceOf(destructible.address);