forked from Calamari/BehaviorTree.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnode_spec.js
More file actions
56 lines (47 loc) · 1.25 KB
/
Copy pathnode_spec.js
File metadata and controls
56 lines (47 loc) · 1.25 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
53
54
55
56
/* globals BehaviorTree */
describe('Node', function() {
describe('can be constructed with', function() {
describe('an object containing', function() {
var node;
describe('a title', function() {
beforeEach(function() {
node = new BehaviorTree.Node({
title: 'firstNode'
});
});
it('and the title is saved on the instance', function() {
expect(node.title).to.eql('firstNode');
});
});
describe('a run method', function() {
beforeEach(function() {
node = new BehaviorTree.Node({
run: function() {
return true;
}
});
});
it('and it is available on the instance', function() {
expect(node.run()).to.be.true;
});
});
});
});
describe('an instance', function() {
var node;
beforeEach(function() {
node = new BehaviorTree.Node({
title: 'node'
});
});
it('has a start method', function() {
expect(node).to.respondTo('start');
});
it('has a end method', function() {
expect(node).to.respondTo('end');
});
it('has a run method', function() {
expect(node).to.respondTo('run');
});
});
});