085e33ce by Michael Richards

Include grunt-jasmine-task to run specs as part of the build process.

1 parent 29f7ffa2
...@@ -8,6 +8,9 @@ module.exports = function(grunt) { ...@@ -8,6 +8,9 @@ module.exports = function(grunt) {
8 '// author: <%= pkg.author %>\n' + 8 '// author: <%= pkg.author %>\n' +
9 '// license: <%= pkg.licenses[0].type %>' 9 '// license: <%= pkg.licenses[0].type %>'
10 }, 10 },
11 jasmine: {
12 all: ['spec/index.html']
13 },
11 lint: { 14 lint: {
12 files: ['grunt.js', 'lib/**/*.js', 'spec/**/*.js'] 15 files: ['grunt.js', 'lib/**/*.js', 'spec/**/*.js']
13 }, 16 },
...@@ -19,11 +22,11 @@ module.exports = function(grunt) { ...@@ -19,11 +22,11 @@ module.exports = function(grunt) {
19 }, 22 },
20 watch: { 23 watch: {
21 files: 'src/rivets.coffee', 24 files: 'src/rivets.coffee',
22 tasks: 'build' 25 tasks: 'build spec'
23 }, 26 },
24 }); 27 });
25 28
26 grunt.registerTask('default', 'watch'); 29 grunt.loadNpmTasks('grunt-jasmine-task');
27 30
28 grunt.registerTask('compile', 'Compiles CoffeeScript source into JavaScript.', function(){ 31 grunt.registerTask('compile', 'Compiles CoffeeScript source into JavaScript.', function(){
29 var coffee = require('coffee-script'); 32 var coffee = require('coffee-script');
...@@ -32,5 +35,7 @@ module.exports = function(grunt) { ...@@ -32,5 +35,7 @@ module.exports = function(grunt) {
32 if (js) grunt.file.write('lib/rivets.js', banner + js); 35 if (js) grunt.file.write('lib/rivets.js', banner + js);
33 }); 36 });
34 37
38 grunt.registerTask('default', 'watch');
39 grunt.registerTask('spec', 'jasmine');
35 grunt.registerTask('build', 'compile min'); 40 grunt.registerTask('build', 'compile min');
36 }; 41 };
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
15 }, 15 },
16 "devDependencies" : { 16 "devDependencies" : {
17 "grunt" : "0.3.x", 17 "grunt" : "0.3.x",
18 "grunt-jasmine-task" : "0.2.x",
18 "coffee-script" : "1.3.x" 19 "coffee-script" : "1.3.x"
19 } 20 }
20 } 21 }
......