Created
April 8, 2016 17:16
-
-
Save Arachnid/440e3f9b4bd2e0745b5dc410c5c17180 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
contract('Test', function(accounts) { | |
it('should increment', function(done) { | |
var test = Test.deployed(); | |
test.increment().then(function(ret) { | |
return test.i.call(); | |
}).then(function(ret) { | |
assert.equal(ret.valueOf(), 1); | |
return test.increment(); | |
}).then(function(ret) { | |
return test.i.call(); | |
}).then(function(ret) { | |
assert.equal(ret.valueOf(), 2); | |
}).then(done).catch(done); | |
}); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
contract Test { | |
uint public i; | |
function increment() { | |
i += 1; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment