File tree Expand file tree Collapse file tree 3 files changed +42
-0
lines changed Expand file tree Collapse file tree 3 files changed +42
-0
lines changed Original file line number Diff line number Diff line change
1
+ var util = require ( 'util' ) ,
2
+ EventEmitter2 = require ( 'eventemitter2' ) . EventEmitter2 ,
3
+ StreamMock = require ( './stream' ) . StreamMock ;
4
+
5
+ var ChildProcessMock = exports . ChildProcessMock = function ( ) {
6
+ EventEmitter2 . call ( this ) ;
7
+
8
+ this . stdout = new StreamMock ( ) ;
9
+ this . stderr = new StreamMock ( ) ;
10
+ } ;
11
+ util . inherits ( ChildProcessMock , EventEmitter2 ) ;
12
+
Original file line number Diff line number Diff line change
1
+ var util = require ( 'util' ) ,
2
+ broadway = require ( 'broadway' ) ,
3
+ ChildProcessMock = require ( './child-process' ) . ChildProcessMock ;
4
+
5
+ var MonitorMock = exports . MonitorMock = function ( options ) {
6
+ broadway . App . call ( this , options ) ;
7
+
8
+ this . child = new ChildProcessMock ( ) ;
9
+ } ;
10
+ util . inherits ( MonitorMock , broadway . App ) ;
11
+
Original file line number Diff line number Diff line change
1
+ var util = require ( 'util' ) ,
2
+ EventEmitter2 = require ( 'eventemitter2' ) . EventEmitter2 ;
3
+
4
+ var StreamMock = exports . StreamMock = function ( ) {
5
+ EventEmitter2 . call ( this ) ;
6
+
7
+ this . contents = [ ] ;
8
+ this . closed = false ;
9
+ } ;
10
+ util . inherits ( StreamMock , EventEmitter2 ) ;
11
+
12
+ StreamMock . prototype . write = function ( data ) {
13
+ this . contents . push ( data ) ;
14
+ } ;
15
+
16
+ StreamMock . prototype . close = function ( ) {
17
+ this . closed = true ;
18
+ } ;
19
+
You can’t perform that action at this time.
0 commit comments