Skip to content

Commit

Permalink
Fix tests after the deletion of the broken file
Browse files Browse the repository at this point in the history
  • Loading branch information
SBoudrias committed Feb 18, 2014
1 parent 13e1c4a commit feea0e0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
3 changes: 1 addition & 2 deletions gulpfile.js
Expand Up @@ -21,8 +21,7 @@ gulp.task('test', function (cb) {

gulp.task('static', function () {
return gulp.src([
'test/**/*.js',
'!test/fixtures/**/*.js',
'test/*.js',
'lib/**/*.js',
'benchmark/**/*.js',
'main.js',
Expand Down
11 changes: 5 additions & 6 deletions lib/actions/actions.js
Expand Up @@ -126,7 +126,7 @@ actions.copy = function copy(source, destination, process) {
*
* A copy method skiping templating and conflict checking. It will allow copying
* a large amount of files without causing too much recursion errors. You should
* never use this method, unless there's no other solution.
* never use this method, unless there's no other solution.
*
* @param {String} source Source file to copy from. Relative to this.sourceRoot()
* @param {String} destination Destination file to write to. Relative to this.destinationRoot()
Expand Down Expand Up @@ -274,21 +274,20 @@ actions.checkForCollision = function checkForCollision(filepath, content, cb) {
* @param {String} source Source file to read from. Relative to this.sourceRoot()
* @param {String} destination Destination file to write to. Relative to this.destinationRoot().
* @param {Object} data Hash to pass to the template. Leave undefined to use the generator instance context.
* @param {Object} options
* @param {Object} options
*/

actions.template = function template(source, destination, data, options) {
data = data || this;
destination = destination || source;
destination = this.engine(destination || source, data, options);

if (!this.isPathAbsolute(source)) {
source = path.join(this.sourceRoot(), source);
source = path.join(this.sourceRoot(), this.engine(source, data, options));
}

var body = this.read(source, 'utf8');
var writeFile = { mode: fs.statSync(source).mode };

destination = this.engine(destination, data, options);
body = this.engine(body, data, options);

this.write(destination, body, writeFile);
Expand Down Expand Up @@ -362,7 +361,7 @@ actions.directory = function directory(source, destination, process) {
*
* A copy method skiping templating and conflict checking. It will allow copying
* a large amount of files without causing too much recursion errors. You should
* never use this method, unless there's no other solution.
* never use this method, unless there's no other solution.
*
* @param {String} source Source directory to copy from. Relative to this.sourceRoot()
* @param {String} destination Directory to copy the source files into.Relative to this.destinationRoot().
Expand Down
4 changes: 2 additions & 2 deletions test/actions.js
Expand Up @@ -204,7 +204,7 @@ describe('yeoman.generators.Base', function () {
this.dummy.template('perm-test.js', 'write/to/perm-test.js');
this.dummy.template('foo-template.js', 'write/to/from-template.js');
this.dummy.template('foo-template.js');
this.dummy.template('<%=foo%>-template.js');
this.dummy.template('<%=foo%>-file.js');
this.dummy.template('foo-template.js', 'write/to/<%=foo%>-directory/from-template.js', {
foo: 'bar'
});
Expand Down Expand Up @@ -247,7 +247,7 @@ describe('yeoman.generators.Base', function () {
});

it('process underscode templates in destination filename', function () {
var body = fs.readFileSync('fooooooo-template.js', 'utf8');
var body = fs.readFileSync('fooooooo-file.js', 'utf8');
assert.textEqual(body, 'var fooooooo = \'fooooooo\';\n');
});

Expand Down
1 change: 1 addition & 0 deletions test/fixtures/fooooooo-file.js
@@ -0,0 +1 @@
var <%= foo %> = '<%= foo %>';

0 comments on commit feea0e0

Please sign in to comment.