Skip to content

Commit 3034196

Browse files
committed
Add tests.
1 parent 349b09a commit 3034196

File tree

6 files changed

+42
-0
lines changed

6 files changed

+42
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<body>
4+
<h1><<Hi>></h1>
5+
</body>
6+
</html>

test/expected/codeblocks.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<html>
2+
<body style="color: red;">
3+
{{#if `age <= 40`}}<p style="color: red;">Young</p>{{/if}}
4+
</body>
5+
</html>
6+
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<body>
4+
<h1><<Hi>></h1>
5+
</body>
6+
</html>

test/fixtures/codeblocks.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
body,
2+
p {
3+
color: red;
4+
}

test/fixtures/codeblocks.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<html><link rel="stylesheet" href="codeblocks.css" />
2+
<body>
3+
{{#if `age <= 40`}}<p>Young</p>{{/if}}
4+
</body>
5+
</html>
6+

test/main.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,18 @@ describe('gulp-inline-css', function() {
107107
compare(path.join('test', 'fixtures', 'multiple', 'one', 'in.html'), path.join('test', 'expected', 'multiple', 'one', 'out.html'), options, function () {});
108108
compare(path.join('test', 'fixtures', 'multiple', 'two', 'in.html'), path.join('test', 'expected', 'multiple', 'two', 'out.html'), options, done);
109109
});
110+
111+
it('Should ignore hbs code blocks', function(done) {
112+
var options = {};
113+
compare(path.join('test', 'fixtures', 'codeblocks.html'), path.join('test', 'expected', 'codeblocks.html'), options, done);
114+
});
115+
116+
it('Should ignore user defined code blocks', function(done) {
117+
var options = {
118+
codeBlocks: {
119+
craze: { start: '<<', end: '>>' }
120+
}
121+
};
122+
compare(path.join('test', 'fixtures', 'codeblocks-external.html'), path.join('test', 'expected', 'codeblocks-external.html'), options, done);
123+
});
110124
});

0 commit comments

Comments
 (0)