Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Commit failing tests. Had to make a slight change to how the addition…

…al blank lang is processed so that the same module can be built twice in the same process.
  • Loading branch information...
commit 999b021ce0950cdff2b79e6f1db467af89316ec8 1 parent c245527
@unkillbob unkillbob authored
View
5 lib/module.js
@@ -409,10 +409,9 @@ var buildCoverage = function (mod, name, callback) {
exports.coverage = buildCoverage;
var buildLang = function (mod, name, callback) {
- var langs = mod.config.lang,
+ var langs = [''].concat(mod.config.lang),
stack = new Stack();
- langs.unshift('');
log.info('shifting ' + langs.length + ' langs for ' + name);
langs.forEach(function (lang) {
@@ -798,7 +797,7 @@ var exec = function (exec, name, callback) {
exports.exec = exec;
exports.build = function (mod, name, options, callback) {
-
+
mod.buildDir = options['build-dir'];
var end = function () {
View
9 tests/1-args.js
@@ -23,6 +23,7 @@ var argsTests = {
'--semi': 'semi',
'--istanbul': 'istanbul',
'--progress': 'progress',
+ '--assets': 'assets',
'--csslint': 'csslint',
'--coverage': 'coverage',
'--clean': 'clean',
@@ -109,6 +110,14 @@ var tests = {
assert.isFalse(topic.semi);
}
},
+ 'should parse --no-assets': {
+ topic: function() {
+ return args.parse(['', '', '--no-assets']);
+ },
+ 'assets should be false': function(topic) {
+ assert.isFalse(topic.assets);
+ }
+ },
'should not parse --no-fail': {
topic: function() {
return args.parse(['', '', '--no-fail']);
View
30 tests/6-builder-uglify-calendar.js
@@ -11,11 +11,16 @@ var vows = require('vows'),
srcBase = path.join(base, 'src/calendar'),
rimraf = require('rimraf');
-function createTests() {
+function createTests(buildSkin) {
return {
'clean build': {
topic: function() {
- rimraf(path.join(buildBase, 'calendar'), this.callback);
+ var self = this;
+ rimraf(path.join(buildBase, 'calendar-base'), function() {
+ rimraf(path.join(buildBase, 'calendarnavigator'), function() {
+ rimraf(path.join(buildBase, 'calendar'), self.callback);
+ });
+ });
},
'should not have build dir and': {
topic: function() {
@@ -47,7 +52,8 @@ function createTests() {
csslint: false,
fail: true,
'cache': false,
- cssproc: 'http://foobar.com/baz/'
+ cssproc: 'http://foobar.com/baz/',
+ assets: buildSkin
}, function() {
process.exit = _exit;
self.callback(null, {
@@ -135,6 +141,7 @@ function createTests() {
}
};
+ if (buildSkin) {
context['should create assets dir and'] = {
topic: function() {
fs.stat(path.join(buildBase, 'calendar', 'assets'), this.callback);
@@ -171,6 +178,20 @@ function createTests() {
assert.isTrue(stat.toString().indexOf('http://foobar.com/baz/calendar/assets/skins/sam/my-image.png') > -1);
}
};
+ } else {
+ context['should not create assets dir and'] = {
+ topic: function() {
+ var self = this;
+ fs.stat(path.join(buildBase, 'calendar', 'assets'), function(err) {
+ self.callback(null, err);
+ });
+ },
+ 'should not create build/calendar/assets': function(foo, err) {
+ assert.isNotNull(err);
+ assert.equal(err.code, 'ENOENT');
+ }
+ };
+ }
return context;
}())
@@ -179,4 +200,5 @@ function createTests() {
};
}
-vows.describe('building calendar with UglifyJS').addBatch(createTests()).export(module);
+vows.describe('building calendar with UglifyJS').addBatch(createTests(true)).export(module);
+vows.describe('building calendar with UglifyJS and --no-assets').addBatch(createTests(false)).export(module);
Please sign in to comment.
Something went wrong with that request. Please try again.