-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathplugin.spec.js
More file actions
52 lines (37 loc) · 1.14 KB
/
plugin.spec.js
File metadata and controls
52 lines (37 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
* imacss
*
* Copyright(c) 2014 André König <andre.koenig@posteo.de>
* MIT Licensed
*
*/
/**
* @author André König <andre.koenig@posteo.de>
*
*/
'use strict';
var streams = require('stream');
var helper = require('./helper');
var imacss = require('../');
var expect = require('expect.js');
describe('The imacss', function suite () {
var selector = '.imacss';
it('"transform" method should be able to handle globs', function test (done) {
var stream = new streams.Writable();
imacss.transform('./specs/**/*.svg').pipe(stream);
stream._write = function (css) {
css = css.toString('utf-8');
expect(css.substring(0, selector.length)).to.be(selector);
done();
};
});
it('"transform" method should be able to handle a Vinyl file object', function (done) {
var stream = new streams.Writable();
imacss.transform(helper.createImageFile()).pipe(stream);
stream._write = function (css) {
css = css.toString('utf-8');
expect(css.substring(0, selector.length)).to.be(selector);
done();
};
});
});