Skip to content
This repository has been archived by the owner on Apr 20, 2018. It is now read-only.

Commit

Permalink
Remove duplicate function.
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed Apr 13, 2015
1 parent da91838 commit 7bf1442
Showing 1 changed file with 3 additions and 23 deletions.
26 changes: 3 additions & 23 deletions test/test-usemin.js
Expand Up @@ -2,8 +2,6 @@
var path = require('path');
var assert = require('assert');
var grunt = require('grunt');
var rimraf = require('rimraf');
var mkdirp = require('mkdirp');
var helpers = require('./helpers');

grunt.task.init([]);
Expand All @@ -12,27 +10,9 @@ grunt.config.init({});
var opts = grunt.cli.options;
opts.redirect = !opts.silent;

var directory = function directory(dir) {
return function directory(done) {
process.chdir(__dirname);
rimraf(dir, function (err) {
if (err) {
return done(err);
}
mkdirp(dir, function (err) {
if (err) {
return done(err);
}
process.chdir(dir);
done();
});
});
};
};

describe('usemin', function () {
describe('absolute paths', function () {
beforeEach(directory('temp'));
beforeEach(helpers.directory('temp'));

it('should replace with revved files when found', function () {
grunt.file.mkdir('build');
Expand Down Expand Up @@ -125,7 +105,7 @@ describe('usemin', function () {
});

describe('relative paths', function () {
beforeEach(directory('temp'));
beforeEach(helpers.directory('temp'));

it('should replace with revved files when found', function () {
grunt.file.mkdir('build');
Expand Down Expand Up @@ -216,7 +196,7 @@ describe('usemin', function () {

});

before(directory('temp'));
before(helpers.directory('temp'));

it('should work on CSS files', function () {
grunt.file.mkdir('images');
Expand Down

0 comments on commit 7bf1442

Please sign in to comment.