clean-css
Advanced tools
Comparing version 0.5.0 to 0.6.0
@@ -0,1 +1,6 @@ | ||
0.6.0 / 2012-08-05 | ||
================== | ||
* Full Windows support with tests (./test.bat) | ||
0.5.0 / 2012-08-02 | ||
@@ -2,0 +7,0 @@ ================== |
@@ -11,3 +11,3 @@ { | ||
}, | ||
"version": "0.5.0", | ||
"version": "0.6.0", | ||
"main": "index.js", | ||
@@ -14,0 +14,0 @@ "bin": { |
@@ -7,2 +7,4 @@ var vows = require('vows'), | ||
var lineBreak = process.platform == 'win32' ? /\r\n/g : /\n/g; | ||
var batchContexts = function() { | ||
@@ -17,4 +19,4 @@ var context = {}; | ||
return { | ||
plain: fs.readFileSync(path.join(__dirname, 'data', testName + '.css')).toString('utf-8'), | ||
minimized: fs.readFileSync(path.join(__dirname, 'data', testName + '-min.css')).toString('utf-8').replace(/\n/g, '') | ||
plain: fs.readFileSync(path.join(__dirname, 'data', testName + '.css'), 'utf-8').replace(lineBreak, ''), | ||
minimized: fs.readFileSync(path.join(__dirname, 'data', testName + '-min.css'), 'utf-8').replace(lineBreak, '') | ||
}; | ||
@@ -21,0 +23,0 @@ } |
@@ -6,6 +6,12 @@ var vows = require('vows'), | ||
var isWindows = process.platform == 'win32', | ||
lineBreak = isWindows ? /\r\n/g : /\n/g; | ||
var binaryContext = function(options, context) { | ||
context.topic = function() { | ||
// We add __DIRECT__=1 to switch binary into 'non-piped' mode | ||
exec("__DIRECT__=1 ./bin/cleancss " + options, this.callback); | ||
if (isWindows) | ||
exec("set __DIRECT__=1 & node .\\bin\\cleancss " + options, this.callback); | ||
else | ||
exec("__DIRECT__=1 ./bin/cleancss " + options, this.callback); | ||
}; | ||
@@ -16,2 +22,5 @@ return context; | ||
var pipedContext = function(css, options, context) { | ||
if (isWindows) | ||
return {}; | ||
context.topic = function() { | ||
@@ -30,3 +39,3 @@ exec("echo \"" + css + "\" | ./bin/cleancss " + options, this.callback); | ||
'help': binaryContext('-h', { | ||
'should output help': function(error, stdout) { | ||
'should output help': function(error, stdout, stderr) { | ||
assert.equal(/usage:/.test(stdout), true); | ||
@@ -58,3 +67,3 @@ } | ||
'should minimize': function(error, stdout) { | ||
var minimized = fs.readFileSync('./test/data/reset-min.css', 'utf-8').replace(/\n/g, ''); | ||
var minimized = fs.readFileSync('./test/data/reset-min.css', 'utf-8').replace(lineBreak, ''); | ||
assert.equal(stdout, minimized); | ||
@@ -68,4 +77,4 @@ } | ||
'should minimize': function(stdout) { | ||
var minimized = fs.readFileSync('./test/data/reset-min.css', 'utf-8').replace(/\n/g, ''); | ||
var target = fs.readFileSync('./reset-min.css', 'utf-8').replace(/\n/g, ''); | ||
var minimized = fs.readFileSync('./test/data/reset-min.css', 'utf-8').replace(lineBreak, ''); | ||
var target = fs.readFileSync('./reset-min.css', 'utf-8').replace(lineBreak, ''); | ||
assert.equal(minimized, target); | ||
@@ -72,0 +81,0 @@ }, |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
707947
23
14075