Add test for file expand behavior

This commit is contained in:
Tim Hall 2014-06-06 19:33:59 -04:00
parent 86aaa6d453
commit dc793d4843
5 changed files with 11 additions and 24 deletions

1
.gitignore vendored
View File

@ -5,4 +5,3 @@ tmp
tmp tmp
junit junit
.DS_Store .DS_Store
.grunt

View File

@ -88,12 +88,6 @@ module.exports = function(grunt) {
// specs: 'test/fixtures/syntaxError/spec/**/*.js' // specs: 'test/fixtures/syntaxError/spec/**/*.js'
// } // }
// }, // },
fileExpand: {
src: ['test/fixtures/fileExpand/src/**/*.js', '!test/fixtures/fileExpand/src/exclude.js'],
options: {
specs: ['test/fixtures/fileExpand/spec/**/*.js', '!test/fixtures/fileExpand/spec/exclude.js']
}
},
customTemplate: { customTemplate: {
src: 'test/fixtures/pivotal/src/**/*.js', src: 'test/fixtures/pivotal/src/**/*.js',
options: { options: {

View File

@ -1,7 +0,0 @@
describe('fileExpand (excluded spec)', function() {
it('should exclude spec files', function() {
expect(true).not.toBeTruthy();
});
});

View File

@ -1,8 +0,0 @@
describe('fileExpand', function() {
it('should exclude src files', function() {
expect(include).toEqual(true);
expect(typeof exclude).toEqual('undefined');
});
});

View File

@ -1,6 +1,8 @@
'use strict'; 'use strict';
var grunt = require('grunt'); var grunt = require('grunt'),
phantomjs = require('grunt-lib-phantomjs').init(grunt),
jasmine = require('../tasks/lib/jasmine.js').init(grunt, phantomjs);
// Majority of test benefit comes from running the task itself. // Majority of test benefit comes from running the task itself.
@ -39,6 +41,13 @@ exports.jasmine = {
test.equal(normalize(actual),normalize(expected), 'default test runner template'); test.equal(normalize(actual),normalize(expected), 'default test runner template');
test.done();
},
fileExpand: function(test) {
var patterns = ['test/fixtures/fileExpand/src/*.js', '!test/fixtures/fileExpand/src/exclude.js']
var expected = ['test/fixtures/fileExpand/src/include.js'];
test.deepEqual(jasmine.getRelativeFileList('', patterns, {}), expected, 'should properly expand file list')
test.done(); test.done();
} }
}; };