-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontext.js
More file actions
45 lines (36 loc) · 1.02 KB
/
Copy pathcontext.js
File metadata and controls
45 lines (36 loc) · 1.02 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
'use strict';
var should = require('should');
var batch = require('../.');
var name = require('../package').name;
module.exports = function(){
it('should be pinned to the location', function (done){
var input = 'world what up';
batch.these(input, function(){
should(this.path).be
.a.String.and.eql(__filename);
should(this.location).be
.a.String.and.eql([__filename, 12, 11].join(':'));
done();
});
});
it('should provide caller\'s module name at `this`', function (done){
var input = 'world what up';
batch.these(input, function(){
should(this.module).be
.a.String.and.eql(name);
done();
});
});
it('should contain the data given', function(done){
var input = ['data here', 'more data here'];
batch.these(input[0], function(){
should(this.data).be
.an.Array.and.eql([input[0]]);
done();
});
batch.these(input[1], function(){
should(this.data).be
.an.Array.and.eql([input[1]]);
});
});
};