Skip to content
Browse files

growlmock helper for testability, correct helper test

  • Loading branch information...
1 parent 7cee76e commit f75d01240007b432e2043730dce5704f7179fc07 @rburns rburns committed
Showing with 14 additions and 8 deletions.
  1. +7 −1 tasks/growl.js
  2. +7 −7 test/growl_test.js
View
8 tasks/growl.js
@@ -49,7 +49,13 @@ module.exports = function(grunt) {
// HELPERS
// ==========================================================================
- grunt.registerHelper('growl', growlMessage);
+ grunt.registerHelper('growl', function(config){
+ growlMessage(config);
+ });
+
+ grunt.registerHelper('growlmock', function(mock){
+ growlMessage = mock;
+ });
// ==========================================================================
// DEFAULT NOTIFICATIONS
View
14 test/growl_test.js
@@ -21,14 +21,14 @@ var grunt = require('grunt');
*/
exports['growl'] = {
- setUp: function(done) {
- // setup here
- done();
- },
'helper': function(test) {
test.expect(1);
- // tests here
- test.equal(grunt.helper('growl'), 'growl!!!', 'should return the correct value.');
- test.done();
+
+ grunt.helper('growlmock', function(config) {
+ test.equal(config.message, 'test message', 'should use message property.');
+ test.done();
+ });
+
+ grunt.helper('growl', {message:'test message'});
}
};

0 comments on commit f75d012

Please sign in to comment.
Something went wrong with that request. Please try again.