@@ -23,21 +23,21 @@ var indexConnectCallback = function(self, tunnelStub, driverSpy) {
23
23
db . close ( function ( ) {
24
24
self . callback ( err , db , tunnelStub , driverSpy ) ;
25
25
} ) ;
26
- }
26
+ } ;
27
27
} ;
28
28
29
29
vows . describe ( 'index' ) . addBatch ( {
30
30
'a connection with ssh tunnel' : {
31
31
topic : function ( ) {
32
32
// Ensure that require gets a new copy of the module for each test
33
- delete require . cache [ require . resolve ( '../../lib/driver/ mysql' ) ] ;
34
- var driver = require ( '../../lib/driver/ mysql' ) ;
33
+ delete require . cache [ require . resolve ( 'db-migrate- mysql' ) ] ;
34
+ var driver = require ( 'db-migrate- mysql' ) ;
35
35
36
36
// Set up stubs/spies to verify correct flow
37
37
var driverSpy = sinon . spy ( driver , 'connect' ) ;
38
38
var tunnelStub = sinon . stub ( ) . callsArg ( 1 ) ;
39
39
40
- var index = proxyquire ( '../../lib/driver/ index' , {
40
+ var index = proxyquire ( 'db-migrate- index' , {
41
41
'tunnel-ssh' : tunnelStub ,
42
42
'./mysql' : driver
43
43
} ) ;
@@ -78,27 +78,27 @@ vows.describe('index').addBatch({
78
78
'a failed tunnel connection' : {
79
79
topic : function ( ) {
80
80
// Ensure that require gets a new copy of the module for each test
81
- delete require . cache [ require . resolve ( '../../lib/driver/ mysql' ) ] ;
82
- var driver = require ( '../../lib/driver/ mysql' ) ;
81
+ delete require . cache [ require . resolve ( 'db-migrate- mysql' ) ] ;
82
+ var driver = require ( 'db-migrate- mysql' ) ;
83
83
84
84
// Set up stubs/spies to verify correct flow
85
- var tunnelStub = sinon . stub ( ) . callsArgWith ( 1 , new Error ( " error" ) ) ;
85
+ var tunnelStub = sinon . stub ( ) . callsArgWith ( 1 , new Error ( ' error' ) ) ;
86
86
var driverSpy = sinon . spy ( driver , 'connect' ) ;
87
87
88
- var index = proxyquire ( '../../lib/driver/ index' , {
88
+ var index = proxyquire ( 'db-migrate- index' , {
89
89
'tunnel-ssh' : tunnelStub ,
90
90
'./mysql' : driver
91
91
} ) ;
92
92
93
93
index . connect ( validDbConfigWithTunnel , { } , indexConnectCallback ( this , tunnelStub , driverSpy ) ) ;
94
94
} ,
95
95
'should pass the error to the callback' : function ( err , db ) {
96
- assert ( err , " err should be non-null" ) ;
97
- assert ( ! db , " driver should be null or undefined" ) ;
96
+ assert ( err , ' err should be non-null' ) ;
97
+ assert ( ! db , ' driver should be null or undefined' ) ;
98
98
} ,
99
99
'should call tunnel, but not driver.connect' : function ( err , db , tunnelStub , driverSpy ) {
100
- assert ( tunnelStub . calledOnce , " tunnel should be called once" ) ;
101
- assert ( driverSpy . notCalled , " driver.connect should not be called" ) ;
100
+ assert ( tunnelStub . calledOnce , ' tunnel should be called once' ) ;
101
+ assert ( driverSpy . notCalled , ' driver.connect should not be called' ) ;
102
102
}
103
103
}
104
- } ) . export ( module ) ;
104
+ } ) . export ( module ) ;
0 commit comments