1 | var chai = require('chai')
|
2 | , expect = chai.expect
|
3 | , gulp = require('gulp')
|
4 | , through = require('through2')
|
5 | , fs = require('fs')
|
6 | , path = require('path')
|
7 | , inline = require('../');
|
8 |
|
9 | describe('gulp-inline', function() {
|
10 | function inputOutput(name, done) {
|
11 | var base = 'test/fixtures';
|
12 | gulp.src(path.join(base, name + '.html'))
|
13 | .pipe(inline({base: base}))
|
14 | .on('data', function(file) {
|
15 | expect(String(file.contents)).to.equal(fs.readFileSync(path.join(base, name + '-output.html'), 'utf8'));
|
16 | done();
|
17 | });
|
18 | }
|
19 |
|
20 | it('should inline a basic template', function(done) {
|
21 | inputOutput('basic', done);
|
22 | });
|
23 |
|
24 | it('should inline a stylesheet with no script', function(done) {
|
25 | inputOutput('no-script', done);
|
26 | });
|
27 |
|
28 | it('should inline a script with no stylesheet', function(done) {
|
29 | inputOutput('no-style', done);
|
30 | });
|
31 | }); |
\ | No newline at end of file |