Commit df0c2def by Makoto Inoue

Restructure test

parent 14b84962
contract('Bounty', function(accounts) {
it("can create bounty contract with factory address", function(done){
var target = SecureTargetMock.deployed();
SimpleTokenBounty.new(target.address).
then(function(bounty){
return bounty.factoryAddress.call()
......@@ -11,9 +12,12 @@ contract('Bounty', function(accounts) {
then(done);
})
it("can call checkInvariant for SecureTargetMock", function(done){
var bounty;
var targetFactory = SecureTargetFactory.deployed();
describe("SecureTargetMock", function(){
before(function(){
targetFactory = SecureTargetFactory.deployed();
})
it("checkInvariant returns true", function(done){
SimpleTokenBounty.new(targetFactory.address).
then(function(_bounty) {
bounty = _bounty;
......@@ -27,10 +31,14 @@ contract('Bounty', function(accounts) {
}).
then(done);
})
})
it("can call checkInvariant for InsecureTargetMock", function(done){
var bounty;
var targetFactory = InsecureTargetFactory.deployed();
describe("InsecureTargetMock", function(){
before(function(){
targetFactory = InsecureTargetFactory.deployed();
})
it("checkInvariant returns false", function(done){
SimpleTokenBounty.new(targetFactory.address).
then(function(_bounty) {
bounty = _bounty;
......@@ -44,4 +52,5 @@ contract('Bounty', function(accounts) {
}).
then(done);
})
})
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment