tdd integration poc

This commit is contained in:
Iuri Matias 2015-06-09 07:57:19 -04:00
parent 885651c893
commit 0af68cbc9c
6 changed files with 44 additions and 4 deletions

View File

@ -10,7 +10,7 @@
"license": "ISC",
"homepage": "",
"devDependencies": {
"embark-framework": "^0.3.0",
"embark-framework": "/Users/iurimatias/Projects/embark-framework",
"grunt-contrib-clean": "^0.6.0",
"grunt-contrib-coffee": "^0.13.0",
"grunt-contrib-concat": "^0.5.1",
@ -19,6 +19,7 @@
"grunt-contrib-watch": "^0.6.1",
"grunt": "^0.4.5",
"grunt-cli": "^0.1.13",
"matchdep": "^0.3.0"
"matchdep": "^0.3.0",
"python": "^0.0.4"
}
}

View File

@ -0,0 +1,9 @@
EmbarkSpec = require("embark-framework").specs();
SimpleStorage = EmbarkSpec.SimpleStorage;
SimpleStorage.set(100);
a = SimpleStorage.get()
console.log(a)

26
boilerplate/spec/test.js Normal file
View File

@ -0,0 +1,26 @@
var python = require('python').shell;
var web3 = require('web3');
web3.setProvider(new web3.providers.HttpProvider('http://localhost:8101'));
web3.eth.defaultAccount = web3.eth.accounts[0];
fs = require('fs');
source = fs.readFileSync('./app/contracts/simple_storage.sol').toString()
compiled_contracts = web3.eth.compile.solidity(source)
contract = compiled_contracts.SimpleStorage
example_abi = JSON.stringify(contract.info.abiDefinition)
example_binary = contract.code.slice(2)
python("from ethertdd import EvmContract", function() {})
python("example_abi = '" + example_abi + "'", function() {})
python("example_abi", function() { })
python("example_binary = '" + example_binary + "'.decode('hex')", function() {})
python("example_binary", function() { })
python("contract = EvmContract(example_abi, example_binary)", function() {})
python("contract.set(10)", function() {})
console.log("get")
python("contract.get()", function(err, data) { console.log("=>" + data)})

View File

@ -7,4 +7,3 @@ var express = require('express');
var compression = require('compression');
var commander = require('commander');
var wrench = require('wrench');
console.log("dude!!!");

View File

@ -9,6 +9,9 @@
"embark": "./bin/embark"
},
"main": "./index.js",
"directories": {
"lib": "./lib"
},
"dependencies": {
"commander": "^2.8.1",
"compression": "^1.4.3",
@ -27,7 +30,8 @@
"shelljs": "^0.5.0",
"web3": "^0.5.0",
"wrench": "^1.5.8",
"hashmerge": "^1.0.2"
"hashmerge": "^1.0.2",
"python": "^0.0.4"
},
"author": "Iuri Matias <iuri.matias@gmail.com>",
"contributors": [],

1
tasks/spec.coffee Normal file
View File

@ -0,0 +1 @@