Skip to content

Commit 978350d

Browse files
committed
Gonzales 3.0: Update strip-spaces
1 parent 722779e commit 978350d

2 files changed

Lines changed: 17 additions & 17 deletions

File tree

lib/options/strip-spaces.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@ module.exports = (function() {
1818

1919
/**
2020
* Processes tree node.
21-
* @param {String} nodeType
2221
* @param {node} node
2322
*/
24-
process: function(nodeType, node) {
25-
if (nodeType === 's') {
26-
node[0] = trim(node[0]);
23+
process: function(node) {
24+
if (node.is('s')) {
25+
node.content = trim(node.content);
2726
}
28-
if (nodeType === 'stylesheet') {
29-
var lastChild = node[node.length - 1];
30-
if (lastChild[0] === 's') {
31-
lastChild[1] = trim(lastChild[1])
27+
28+
if (node.is('stylesheet')) {
29+
var lastChild = node.last();
30+
if (lastChild.is('s')) {
31+
lastChild.content = trim(lastChild.content)
3232
.replace(/[ \t]+$/, '')
3333
.replace(/[\n]+/g, '\n');
3434
}

test/options/strip-spaces/test.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
var assert = require('assert');
22

3-
describe.skip('options/strip-spaces', function() {
3+
describe('options/strip-spaces', function() {
44
it('Invalid value should not trim trailing spaces', function() {
55
this.comb.configure({ 'strip-spaces': 'foobar' });
66
assert.equal(
@@ -31,7 +31,7 @@ describe.skip('options/strip-spaces', function() {
3131
);
3232
});
3333

34-
it('Should detect strip-spaces option set to `true`', function() {
34+
it.skip('Should detect strip-spaces option set to `true`', function() {
3535
this.shouldDetect(
3636
['strip-spaces'],
3737
'a { color: red }',
@@ -41,7 +41,7 @@ describe.skip('options/strip-spaces', function() {
4141
);
4242
});
4343

44-
it('Should detect strip-spaces option set to `false`', function() {
44+
it.skip('Should detect strip-spaces option set to `false`', function() {
4545
this.shouldDetect(
4646
['strip-spaces'],
4747
'a { color: red } ',
@@ -51,7 +51,7 @@ describe.skip('options/strip-spaces', function() {
5151
);
5252
});
5353

54-
it('Should detect strip-spaces option set to `true` with newline', function() {
54+
it.skip('Should detect strip-spaces option set to `true` with newline', function() {
5555
this.shouldDetect(
5656
['strip-spaces'],
5757
'a { color: red }\nb { color: blue }',
@@ -61,7 +61,7 @@ describe.skip('options/strip-spaces', function() {
6161
);
6262
});
6363

64-
it('Should detect strip-spaces option set to `false` with newline', function() {
64+
it.skip('Should detect strip-spaces option set to `false` with newline', function() {
6565
this.shouldDetect(
6666
['strip-spaces'],
6767
'a { color: red } \nb { color: blue }',
@@ -71,7 +71,7 @@ describe.skip('options/strip-spaces', function() {
7171
);
7272
});
7373

74-
it('Should detect strip-spaces option set to `true` inside a value', function() {
74+
it.skip('Should detect strip-spaces option set to `true` inside a value', function() {
7575
this.shouldDetect(
7676
['strip-spaces'],
7777
'a {\n color:\n red }',
@@ -81,7 +81,7 @@ describe.skip('options/strip-spaces', function() {
8181
);
8282
});
8383

84-
it('Should detect strip-spaces option set to `false` inside a value', function() {
84+
it.skip('Should detect strip-spaces option set to `false` inside a value', function() {
8585
this.shouldDetect(
8686
['strip-spaces'],
8787
'a {\n color: \n red }',
@@ -91,7 +91,7 @@ describe.skip('options/strip-spaces', function() {
9191
);
9292
});
9393

94-
it('Should detect strip-spaces option set to `true` if the only trailing space is the last newline', function() {
94+
it.skip('Should detect strip-spaces option set to `true` if the only trailing space is the last newline', function() {
9595
this.shouldDetect(
9696
['strip-spaces'],
9797
'a { color: red }\n',
@@ -101,7 +101,7 @@ describe.skip('options/strip-spaces', function() {
101101
);
102102
});
103103

104-
it('Should detect strip-spaces option set to `false` if there is more than one newline at the end', function() {
104+
it.skip('Should detect strip-spaces option set to `false` if there is more than one newline at the end', function() {
105105
this.shouldDetect(
106106
['strip-spaces'],
107107
'a { color: red }\n\n',

0 commit comments

Comments
 (0)