var assert = require('assert');
var CleanCSS = require('../index');
-var lineBreak = process.platform == 'win32' ? /\r\n/g : /\n/g;
+var lineBreak = require('os').EOL;
var batchContexts = function() {
var context = {};
var path = require('path');
var isWindows = process.platform == 'win32';
-var lineBreak = isWindows ? /\r\n/g : /\n/g;
+var lineBreakRegExp = new RegExp(require('os').EOL, 'g');
var binaryContext = function(options, context) {
if (isWindows)
};
var readFile = function(filename) {
- return fs.readFileSync(filename, { encoding: 'utf-8' }).replace(lineBreak, '');
+ return fs.readFileSync(filename, { encoding: 'utf-8' }).replace(lineBreakRegExp, '');
};
var deleteFile = function(filename) {
}),
'from source': binaryContext('./test/data/reset.css', {
'should minimize': function(error, stdout) {
- var minimized = fs.readFileSync('./test/data/reset-min.css', 'utf-8').replace(lineBreak, '');
+ var minimized = fs.readFileSync('./test/data/reset-min.css', 'utf-8').replace(lineBreakRegExp, '');
assert.equal(stdout, minimized);
}
}),
var path = require('path');
var CleanCSS = require('../index');
-var lineBreak = process.platform == 'win32' ? '\r\n' : '\n';
+var lineBreak = require('os').EOL;
var cssContext = function(groups, options) {
var context = {};