update demo

This commit is contained in:
Iuri Matias 2015-06-15 06:26:38 -04:00
parent 27c45ba62d
commit 13b7a9f2e5
12 changed files with 28 additions and 4 deletions

View File

@ -66,7 +66,8 @@ program.command('demo').description('create a working dapp with a SimpleStorage
var targetDir = "./embark_demo";
wrench.copyDirSyncRecursive(boilerPath, targetDir);
wrench.copyDirSyncRecursive(demoPath, targetDir + "/app", {forceDelete: true});
wrench.copyDirSyncRecursive(demoPath + "/app", targetDir + "/app", {forceDelete: true});
wrench.copyDirSyncRecursive(demoPath + "/spec", targetDir + "/spec", {forceDelete: true});
cd(targetDir);
run('npm install');

View File

@ -0,0 +1,17 @@
EmbarkSpec = require('embark-framework').Tests;
describe("SimpleStorage", function() {
beforeAll(function() {
SimpleStorage = EmbarkSpec.request("SimpleStorage", [150]);
});
it("should set constructor value", function() {
expect(SimpleStorage.foo()).toEqual('150');
});
it("set storage value", function() {
SimpleStorage.set(100);
expect(SimpleStorage.get()).toEqual('100');
});
})

View File

@ -0,0 +1,9 @@
{
"spec_dir": "spec",
"spec_files": [
"**/*[sS]pec.js"
],
"helpers": [
"helpers/**/*.js"
]
}

View File

@ -12,8 +12,6 @@ var syncMe = require('sync-me');
var methodmissing = require('methodmissing');
var jasmine = require('jasmine');
console.log("embark required");
embark = {}
embark.Tests = require('./lib/test.js');

View File

@ -1 +0,0 @@