From 13b7a9f2e5347575d9e68f3ce78260cb0b6a1b48 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Mon, 15 Jun 2015 06:26:38 -0400 Subject: [PATCH] update demo --- bin/embark | 3 ++- demo/{ => app}/contracts/simple_storage.sol | 0 demo/{ => app}/css/.gitkeep | 0 demo/{ => app}/css/main.css | 0 demo/{ => app}/html/index.html | 0 demo/{ => app}/js/.gitkeep | 0 demo/{ => app}/js/_vendor/jquery.min.js | 0 demo/{ => app}/js/index.js | 0 demo/spec/contracts/simple_storage_spec.js | 17 +++++++++++++++++ demo/spec/support/jasmine.json | 9 +++++++++ index.js | 2 -- tasks/spec.coffee | 1 - 12 files changed, 28 insertions(+), 4 deletions(-) rename demo/{ => app}/contracts/simple_storage.sol (100%) rename demo/{ => app}/css/.gitkeep (100%) rename demo/{ => app}/css/main.css (100%) rename demo/{ => app}/html/index.html (100%) rename demo/{ => app}/js/.gitkeep (100%) rename demo/{ => app}/js/_vendor/jquery.min.js (100%) rename demo/{ => app}/js/index.js (100%) create mode 100644 demo/spec/contracts/simple_storage_spec.js create mode 100644 demo/spec/support/jasmine.json delete mode 100644 tasks/spec.coffee diff --git a/bin/embark b/bin/embark index e4e4f5ae1..2cd96aef3 100644 --- a/bin/embark +++ b/bin/embark @@ -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'); diff --git a/demo/contracts/simple_storage.sol b/demo/app/contracts/simple_storage.sol similarity index 100% rename from demo/contracts/simple_storage.sol rename to demo/app/contracts/simple_storage.sol diff --git a/demo/css/.gitkeep b/demo/app/css/.gitkeep similarity index 100% rename from demo/css/.gitkeep rename to demo/app/css/.gitkeep diff --git a/demo/css/main.css b/demo/app/css/main.css similarity index 100% rename from demo/css/main.css rename to demo/app/css/main.css diff --git a/demo/html/index.html b/demo/app/html/index.html similarity index 100% rename from demo/html/index.html rename to demo/app/html/index.html diff --git a/demo/js/.gitkeep b/demo/app/js/.gitkeep similarity index 100% rename from demo/js/.gitkeep rename to demo/app/js/.gitkeep diff --git a/demo/js/_vendor/jquery.min.js b/demo/app/js/_vendor/jquery.min.js similarity index 100% rename from demo/js/_vendor/jquery.min.js rename to demo/app/js/_vendor/jquery.min.js diff --git a/demo/js/index.js b/demo/app/js/index.js similarity index 100% rename from demo/js/index.js rename to demo/app/js/index.js diff --git a/demo/spec/contracts/simple_storage_spec.js b/demo/spec/contracts/simple_storage_spec.js new file mode 100644 index 000000000..551d31e55 --- /dev/null +++ b/demo/spec/contracts/simple_storage_spec.js @@ -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'); + }); + +}) diff --git a/demo/spec/support/jasmine.json b/demo/spec/support/jasmine.json new file mode 100644 index 000000000..a5f29329d --- /dev/null +++ b/demo/spec/support/jasmine.json @@ -0,0 +1,9 @@ +{ + "spec_dir": "spec", + "spec_files": [ + "**/*[sS]pec.js" + ], + "helpers": [ + "helpers/**/*.js" + ] +} diff --git a/index.js b/index.js index d853a91e7..29c50c09f 100644 --- a/index.js +++ b/index.js @@ -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'); diff --git a/tasks/spec.coffee b/tasks/spec.coffee deleted file mode 100644 index 8b1378917..000000000 --- a/tasks/spec.coffee +++ /dev/null @@ -1 +0,0 @@ -