Permalink
Browse files

add shUnit2 test suite, run via grunt test

  • Loading branch information...
JamieMason committed Nov 5, 2013
1 parent 3faf245 commit 4a088cafcf594594f05177b4624b24c3ce832db8
View
@@ -30,6 +30,17 @@ module.exports = function(grunt) {
dest: 'README.md'
}]
}
+ },
+
+ shell: {
+ bashTests: {
+ command: './test/imageOptimBashLib_test',
+ options: {
+ callback: function(err, stdout) {
+ return err ? grunt.fatal(stdout) : grunt.log.write(stdout);
+ }
+ }
+ }
}
});
@@ -38,7 +49,9 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-watch');
+ grunt.loadNpmTasks('grunt-shell');
grunt.registerTask('build', ['concat', 'environment']);
+ grunt.registerTask('test', ['shell:bashTests']);
};
View
@@ -46,8 +46,7 @@
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-jshint": "~0.6.0",
"grunt-contrib-watch": "~0.5.3",
- "grunt-jasmine-node": "~0.1.0",
- "jasmine-expect": "~1.21.0"
+ "grunt-shell": "~0.5.0"
},
"contributors": [
"Jamie Mason (https://github.com/JamieMason)",
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+# ------------------------------------
+# SETUP
+# ------------------------------------
+
+# get location of this test file
+PROJECT_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/.."
+
+# import the bash library for testing
+source "$PROJECT_ROOT/bin/imageOptimBashLib"
+
+# ------------------------------------
+# TESTS
+# ------------------------------------
+
+function testWeCanRunTests () {
+ assertEquals "foo" "foo"
+}
+
+# ------------------------------------
+# RUN
+# ------------------------------------
+
+. "$PROJECT_ROOT/test/shunit2/src/shunit2"
View
@@ -1,7 +0,0 @@
-describe('ImageOptim-CLI Bash Library', function() {
-
- 'use strict';
-
- require('jasmine-expect');
-
-});
Oops, something went wrong.

0 comments on commit 4a088ca

Please sign in to comment.