@@ -215,7 +215,7 @@ func TestMigrate(t *testing.T) {
215
215
},
216
216
},
217
217
{
218
- name : "v0 -> v1: with error " ,
218
+ name : "v0 -> v1: missing method aborts migration " ,
219
219
file : file.File {
220
220
Path : "/foobar" ,
221
221
FileName : "001_foobar.up.gm" ,
@@ -235,6 +235,48 @@ func TestMigrate(t *testing.T) {
235
235
Errors : []error {gomethods .MissingMethodError ("v001_non_existing_method_up" )},
236
236
},
237
237
},
238
+ {
239
+ name : "v0 -> v1: wrong signature method aborts migration" ,
240
+ file : file.File {
241
+ Path : "/foobar" ,
242
+ FileName : "001_foobar.up.gm" ,
243
+ Version : 1 ,
244
+ Name : "foobar" ,
245
+ Direction : direction .Up ,
246
+ Content : []byte (`
247
+ V001_init_organizations_up
248
+ V001_method_with_wrong_signature_up
249
+ V001_init_users_up
250
+ ` ),
251
+ },
252
+ expectedResult : ExpectedMigrationResult {
253
+ Organizations : []Organization {},
254
+ Organizations_v2 : []Organization_v2 {},
255
+ Users : []User {},
256
+ Errors : []error {gomethods .WrongMethodSignatureError ("V001_method_with_wrong_signature_up" )},
257
+ },
258
+ },
259
+ {
260
+ name : "v1 -> v0: wrong signature method aborts migration" ,
261
+ file : file.File {
262
+ Path : "/foobar" ,
263
+ FileName : "001_foobar.down.gm" ,
264
+ Version : 1 ,
265
+ Name : "foobar" ,
266
+ Direction : direction .Down ,
267
+ Content : []byte (`
268
+ V001_init_users_down
269
+ V001_method_with_wrong_signature_down
270
+ V001_init_organizations_down
271
+ ` ),
272
+ },
273
+ expectedResult : ExpectedMigrationResult {
274
+ Organizations : []Organization {},
275
+ Organizations_v2 : []Organization_v2 {},
276
+ Users : []User {},
277
+ Errors : []error {gomethods .WrongMethodSignatureError ("V001_method_with_wrong_signature_down" )},
278
+ },
279
+ },
238
280
}
239
281
240
282
for _ , m := range migrations {
0 commit comments