Skip to content

Commit

Permalink
readme expanded, enchanced tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Bartvds committed Apr 29, 2013
1 parent da15612 commit 3675737
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 11 deletions.
3 changes: 3 additions & 0 deletions Gruntfile.js
Expand Up @@ -44,6 +44,9 @@ module.exports = function (grunt) {
src: ['extra.js'],
dest: 'test/tmp/wrapfunction',
expand: true,
rename: function(dest, src) {
return path.join(dest, src.replace(/(\.[\w]+)$/g, '.tagged$1'));
},
options: {
seperator:'\n',
testValue: 'yo!',
Expand Down
24 changes: 16 additions & 8 deletions README.md
Expand Up @@ -21,16 +21,24 @@ grunt.initConfig({

// wrap my modules with define
wrap: {
modules: {
basic: {
src: ['assets/*.js'],
dest: 'dist/',
wrapper: ['define(function (require, exports, module) {\n', '\n});']
// wrapper can also be a function, like so:
//
// wrapper: function(filepath, options) {
// // ...
// return ['define(function (require, exports, module) {\n', '\n});'];
// }
},
advanced: {
cwd: 'files/'
expand: true,
src: ['**/*.js', '**/*.css'],
dest: 'dist/',
seperator: '\n',
indent: '\t',
wrapper: function(filepath, options) {
return ['// ' + filepath, ''];
},
rename: function(dest, src) {
return path.join(dest, src.replace(/(\.[\w]+)$/g, '.tagged$1'));
}
}
},

Expand All @@ -46,7 +54,7 @@ In lieu of a formal styleguide, take care to maintain the existing coding style.
for any new or changed functionality. Lint and test your code using [grunt][grunt].

## Release History
* 2013 Arp 30 - v0.3.0 - Rewrite with improved grunt file/option convention support, added unit test (Bartvds), grunt version bump to 0.4.1
* 2013 Apr 30 - v0.3.0 - Rewrite with grunt file/option convention, unit test (Bartvds), grunt version to 0.4.1
* 2013 Jan 31 - v0.2.0 - Implements grunt 0.4 compatibility measures, breaking support for grunt 0.3.x
* 2012 Oct 4 - v0.1.0 - Initial release.

Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions test/grunt-wrap_test.js
Expand Up @@ -48,10 +48,10 @@ exports.gruntwrap = {

var expected, actual;

test.ok(grunt.file.exists('test/tmp/wrapfunction/extra.js'), 'should respect extra.js');
test.ok(grunt.file.exists('test/tmp/wrapfunction/extra.tagged.js'), 'should output extra.tagged.js');

expected= grunt.file.read('test/expected/wrapfunction/extra.js');
actual = grunt.file.read('test/tmp/wrapfunction/extra.js');
expected= grunt.file.read('test/expected/wrapfunction/extra.tagged.js');
actual = grunt.file.read('test/tmp/wrapfunction/extra.tagged.js');
test.equal(expected, actual, 'should wrap extra.js using function correctly');

test.done();
Expand Down

0 comments on commit 3675737

Please sign in to comment.