From 825203fcecb134c96efa95ddadbe4f6bda7fe4ff Mon Sep 17 00:00:00 2001 From: Manuel Araoz Date: Mon, 12 Sep 2016 19:16:37 -0700 Subject: [PATCH] write ownable simple test --- contracts/Ownable.sol | 2 +- migrations/2_deploy_contracts.js | 1 + test/ownable.js | 11 +++++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 test/ownable.js diff --git a/contracts/Ownable.sol b/contracts/Ownable.sol index 1f80c8f67..86d9483a2 100644 --- a/contracts/Ownable.sol +++ b/contracts/Ownable.sol @@ -3,7 +3,7 @@ * Base contract with an owner */ contract Ownable { - address owner; + address public owner; function Ownable() { owner = msg.sender; diff --git a/migrations/2_deploy_contracts.js b/migrations/2_deploy_contracts.js index 6731fa0ec..8db14c0b9 100644 --- a/migrations/2_deploy_contracts.js +++ b/migrations/2_deploy_contracts.js @@ -2,5 +2,6 @@ module.exports = function(deployer) { deployer.deploy(PullPaymentBid); deployer.deploy(BadArrayUse); deployer.deploy(Bounty); + deployer.deploy(Ownable); deployer.deploy(LimitFunds); }; diff --git a/test/ownable.js b/test/ownable.js new file mode 100644 index 000000000..7649ecd39 --- /dev/null +++ b/test/ownable.js @@ -0,0 +1,11 @@ +contract('Ownable', function(accounts) { + it("should have an owner", function(done) { + var ownable = Ownable.deployed(); + return ownable.owner() + .then(function(owner) { + assert.isTrue(owner != 0); + }) + .then(done) + + }); +});