diff --git a/TODO b/TODO
index 6766aa8..fb44361 100644
--- a/TODO
+++ b/TODO
@@ -3,8 +3,8 @@
- [ ] folders
-- [ ] string controller
-- [ ] boolean controller
- [ ] function controller
- [ ] color controller
+- [x] string controller
+- [x] boolean controller
diff --git a/bower.json b/bower.json
index 08604f0..0b348b5 100644
--- a/bower.json
+++ b/bower.json
@@ -13,14 +13,10 @@
"ignore": [
"**/.*",
"node_modules",
- "components",
- "test",
- "tests"
+ "tests",
+ "docs"
],
"dependencies": {
"polymer": "Polymer/polymer#~0.3.5"
- },
- "devDependencies": {
- "underscore": "~1.6.0"
}
}
diff --git a/build/gui.html b/build/gui.html
index ec1fa5d..ec856da 100644
--- a/build/gui.html
+++ b/build/gui.html
@@ -1,20 +1,4 @@
-
+
+})( this );
+
+
diff --git a/gulpfile.js b/gulpfile.js
index 3456f59..5fa2b69 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -5,24 +5,45 @@
*/
var gulp = require( 'gulp' ),
+ stylus = require( 'gulp-stylus' ),
+ plates = require( 'gulp-plates' ),
+ rename = require( 'gulp-rename' ),
+ vulcan = require( 'gulp-vulcanize' ),
+ nib = require( 'nib' ),
fs = require( 'fs' ),
- $ = require( 'gulp-load-plugins' )( { 'pattern': '*' } );
+ marked = require( 'marked' ),
+ karma = require( 'karma' ).server;
var paths = {
main: 'gui.html',
css: 'elements/**/*.styl',
html: 'elements/**/*.html',
js: 'elements/**/*.js',
-}
+};
function stylus( src, dest ) {
gulp.src( src )
- .pipe( $.stylus( { use: [ $.nib() ] } ) )
+ .pipe( stylus( { use: [ nib() ] } ) )
.pipe( gulp.dest( dest ) );
}
+gulp.task( 'docs', function() {
+
+ stylus( 'docs/*.styl', 'docs' );
+
+ var content = {
+ readme: marked( fs.readFileSync( 'README.md', 'utf8' ) )
+ }
+
+ gulp.src( 'docs/template.html' )
+ .pipe( plates( content ) )
+ .pipe( rename( 'index.html' ) )
+ .pipe( gulp.dest( './' ) );
+
+} );
+
gulp.task( 'css', function() {
stylus( paths.css, 'elements' );
@@ -32,7 +53,7 @@ gulp.task( 'css', function() {
gulp.task( 'vulcanize', function() {
gulp.src( paths.main )
- .pipe( $.vulcanize( {
+ .pipe( vulcan( {
dest: 'build',
inline: true
// strip: true
@@ -40,22 +61,18 @@ gulp.task( 'vulcanize', function() {
} );
-gulp.task( 'docs', function() {
-
- stylus( 'docs/*.styl', 'docs' );
+gulp.task( 'test', function( done ) {
- var content = {
- readme: $.marked( fs.readFileSync( 'README.md', 'utf8' ) )
- }
-
- gulp.src( 'docs/template.html' )
- .pipe( $.plates( content ) )
- .pipe( $.rename( 'index.html' ) )
- .pipe( gulp.dest( './' ) );
-
-} );
-
-gulp.task( 'test', function() {
+ karma.start( {
+ // browsers: [ 'Chrome' ],
+ frameworks: [ 'jasmine' ],
+ files: [
+ '../platform/platform.js',
+ 'build/gui.html',
+ 'tests/*.js'
+ ],
+ // singleRun: true
+ }, done );
} );
@@ -63,10 +80,9 @@ gulp.task( 'build', [ 'css', 'vulcanize', 'test', 'docs' ] );
gulp.task( 'default', function() {
- gulp.task( 'build' );
-
gulp.watch( [ paths.css ], [ 'css', 'vulcanize' ] );
- gulp.watch( [ paths.js, paths.main, paths.html ], [ 'vulcanize', 'test' ] );
+ gulp.watch( [ paths.js, paths.main, paths.html ], [ 'vulcanize' ] );
+ // gulp.watch( [ 'build/gui.html', 'tests/*.js' ], [ 'test' ] );
gulp.watch( [ 'README.md', 'docs/*' ], [ 'docs' ] );
} );
diff --git a/package.json b/package.json
index cb3df8e..afdf07e 100644
--- a/package.json
+++ b/package.json
@@ -3,14 +3,14 @@
"version": "0.0.0",
"devDependencies": {
"gulp": "^3.8.7",
- "gulp-connect": "^2.0.6",
- "gulp-load-plugins": "^0.5.3",
"gulp-plates": "0.0.5",
- "gulp-qunit": "^0.3.3",
"gulp-rename": "^1.2.0",
"gulp-stylus": "^1.3.0",
"gulp-vulcanize": "^1.0.0",
"gulp-watch": "^0.6.9",
+ "karma": "^0.12.23",
+ "karma-chrome-launcher": "^0.1.4",
+ "karma-jasmine": "^0.1.5",
"marked": "^0.3.2",
"nib": "^1.0.3"
}
diff --git a/test/runner.html b/test/runner.html
deleted file mode 100644
index f520875..0000000
--- a/test/runner.html
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
dat-gui Test Runner (Mocha)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/test.js b/tests/test.js
new file mode 100644
index 0000000..f3831a3
--- /dev/null
+++ b/tests/test.js
@@ -0,0 +1,29 @@
+describe('Gui', function() {
+
+ it( 'exists', function() {
+
+ expect( Gui ).toBeDefined();
+
+ });
+
+ it( 'has a ready callback', function() {
+
+ var ready = {
+ ready: function() {}
+ };
+
+ spyOn( ready, 'ready' );
+
+ runs( function() {
+ Gui.ready( ready.ready );
+ } );
+
+ waits( 10 );
+
+ runs( function() {
+ expect( ready.ready ).toHaveBeenCalled();
+ } );
+
+ } );
+
+});
\ No newline at end of file