1 | var sass = require('node-sass')
|
2 | , bourbon = require('../');
|
3 |
|
4 | function partialsDir(path) {
|
5 | return __dirname + '/fixtures/concat/' + path;
|
6 | }
|
7 |
|
8 | function errorHandler(err) {
|
9 | var msg = err.message +
|
10 | '\nFile:\n\t' + err.file +
|
11 | ':' + err.line +
|
12 | ':' + err.column;
|
13 | throw new Error(msg);
|
14 | }
|
15 |
|
16 | describe('#with function', function() {
|
17 |
|
18 | it('should concat string paths using #with', function(done) {
|
19 | sass.render({
|
20 | file: __dirname + '/fixtures/concat.scss',
|
21 | includePaths: bourbon.with(partialsDir('dir1'), partialsDir('dir2'), partialsDir('dir3')),
|
22 | error: errorHandler
|
23 | }, function(err, res) {
|
24 | if (err) return done(err);
|
25 | done();
|
26 | });
|
27 | });
|
28 |
|
29 | it('should concat array paths using #with', function(done) {
|
30 | sass.render({
|
31 | file: __dirname + '/fixtures/concat.scss',
|
32 | includePaths: bourbon.with([partialsDir('dir1')], [partialsDir('dir2')], [partialsDir('dir3')]),
|
33 | error: errorHandler
|
34 | }, function(err, res) {
|
35 | if (err) return done(err);
|
36 | done();
|
37 | });
|
38 | });
|
39 |
|
40 | it('should concat mixed args paths using #with', function(done) {
|
41 | sass.render({
|
42 | file: __dirname + '/fixtures/concat.scss',
|
43 | includePaths: bourbon.with([partialsDir('dir1'), partialsDir('dir2')], partialsDir('dir3')),
|
44 | error: errorHandler
|
45 | }, function(err, res) {
|
46 | if (err) return done(err);
|
47 | done();
|
48 | });
|
49 | });
|
50 |
|
51 | });
|