This repository was archived by the owner on Mar 5, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change 11
11
"debug" : " ^1.0.2" ,
12
12
"jscs" : " ^1.5.7" ,
13
13
"jshint" : " ^2.5.1" ,
14
+ "lodash" : " ^2.4.1" ,
14
15
"mocha" : " ^1.20.1" ,
15
16
"node-uuid" : " ^1.4.1" ,
16
17
"should" : " ^4.0.4"
Original file line number Diff line number Diff line change 4
4
* Module dependencies.
5
5
*/
6
6
7
+ var async = require ( 'async' ) ;
8
+ var lodash = require ( 'lodash' ) ;
7
9
var should = require ( 'should' ) ;
8
10
var uuid = require ( 'node-uuid' ) ;
9
11
@@ -23,12 +25,48 @@ describe('Chronos', function() {
23
25
this . chronos . on ( 'debug' , helper . debug ( 'mesos:chronos' ) ) ;
24
26
} ) ;
25
27
28
+ beforeEach ( function ( done ) {
29
+ var self = this ;
30
+
31
+ self . name = 'test-' + uuid . v4 ( ) ;
32
+ self . owner = 'owner@example.org' ;
33
+
34
+ var jobs = { } ;
35
+
36
+ jobs . create = function ( cb ) {
37
+ var options = {
38
+ schedule : 'R10/2012-10-01T05:52:00Z/PT2S' ,
39
+ name : self . name ,
40
+ epsilon : 'PT15M' ,
41
+ command : 'true' ,
42
+ owner : self . owner ,
43
+ async : false ,
44
+ } ;
45
+
46
+ self . chronos . create ( options , cb ) ;
47
+ } ;
48
+
49
+ async . auto ( jobs , done ) ;
50
+ } ) ;
51
+
26
52
it ( 'should return jobs' , function ( done ) {
53
+ var self = this ;
54
+
27
55
this . chronos . list ( function ( err , data ) {
28
56
should . not . exist ( err ) ;
29
57
30
58
should ( data ) . be . instanceof ( Array ) ;
31
59
60
+ var job = lodash . find ( data , function ( job ) {
61
+ return self . name === job . name ;
62
+ } ) ;
63
+
64
+ should . exist ( job ) ;
65
+
66
+ job . name . should . eql ( self . name ) ;
67
+ job . owner . should . eql ( self . owner ) ;
68
+ job . disabled . should . eql ( false ) ;
69
+
32
70
done ( ) ;
33
71
} ) ;
34
72
} ) ;
You can’t perform that action at this time.
0 commit comments