-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspecs.js
44 lines (31 loc) · 1.02 KB
/
specs.js
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
"use strict";
/* jshint undef: true, unused: true */
/* global Turu, describe, it, expect, beforeEach */
describe('Turu: .middle', function () {
beforeEach(Turu.reset);
it('runs the code', function () {
var v = 0;
Turu.middle(function (data) {
if (_.isMatch(data, {action: 'family'}))
v = data.value;
});
Turu.run({action: 'family', value: 'Simpsons'});
expect(v).toEqual('Simpsons');
});
}); // === describe Turu: .middle
describe('Turu: .bottom:', function () {
beforeEach(Turu.reset);
it('runs the code after middle functions', function () {
var v = [];
Turu.bottom(function (data) {
if (_.isMatch(data, {action: 'movie'}))
v.push(data.value + ' last');
});
Turu.middle(function (data) {
if (_.isMatch(data, {action: 'movie'}))
v.push(data.value + ' middle');
});
Turu.run({action: 'movie', value: 'Simpsons'});
expect(v).toEqual(['Simpsons middle', 'Simpsons last']);
});
}); // === describe Turu: .bottom =================