Преглед на файлове

write ownable simple test

Manuel Araoz преди 9 години
родител
ревизия
825203fcec
променени са 3 файла, в които са добавени 13 реда и са изтрити 1 реда
  1. 1 1
      contracts/Ownable.sol
  2. 1 0
      migrations/2_deploy_contracts.js
  3. 11 0
      test/ownable.js

+ 1 - 1
contracts/Ownable.sol

@@ -3,7 +3,7 @@
  * Base contract with an owner
  */
 contract Ownable {
-  address owner;
+  address public owner;
 
   function Ownable() {
     owner = msg.sender;

+ 1 - 0
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);
 };

+ 11 - 0
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)
+
+  });
+});