2017-02-09 19:38:02 -05:00
|
|
|
var assert = require('assert');
|
2017-03-12 12:23:30 +09:00
|
|
|
var Embark = require('embark');
|
|
|
|
var EmbarkSpec = require('../node_modules/embark/lib/core/test.js');
|
2017-02-09 19:38:02 -05:00
|
|
|
var web3 = EmbarkSpec.web3;
|
|
|
|
|
|
|
|
describe("SimpleStorage", function() {
|
|
|
|
before(function(done) {
|
2017-03-11 21:49:12 -05:00
|
|
|
this.timeout(0);
|
2017-02-09 19:38:02 -05:00
|
|
|
var contractsConfig = {
|
|
|
|
"SimpleStorage": {
|
|
|
|
args: [100]
|
|
|
|
}
|
|
|
|
};
|
|
|
|
EmbarkSpec.deployAll(contractsConfig, done);
|
|
|
|
});
|
|
|
|
|
|
|
|
it("should set constructor value", function(done) {
|
|
|
|
SimpleStorage.storedData(function(err, result) {
|
|
|
|
assert.equal(result.toNumber(), 100);
|
|
|
|
done();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it("set storage value", function(done) {
|
|
|
|
SimpleStorage.set(150, function() {
|
|
|
|
SimpleStorage.get(function(err, result) {
|
|
|
|
assert.equal(result.toNumber(), 150);
|
|
|
|
done();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|