@@ -27,7 +27,7 @@ void main() {
2727
2828 final file = File ('${tempDir .path }/lib/app/models/monitor.dart' );
2929 expect (file.existsSync (), isTrue);
30-
30+
3131 final content = file.readAsStringSync ();
3232 expect (content, contains ('class Monitor extends Model' ));
3333 expect (content, contains ("String get table => 'monitors'" ));
@@ -40,7 +40,7 @@ void main() {
4040
4141 final file = File ('${tempDir .path }/lib/app/models/category.dart' );
4242 expect (file.existsSync (), isTrue);
43-
43+
4444 final content = file.readAsStringSync ();
4545 expect (content, contains ('class Category extends Model' ));
4646 expect (content, contains ("String get table => 'categories'" ));
@@ -52,7 +52,7 @@ void main() {
5252
5353 final file = File ('${tempDir .path }/lib/app/models/admin/profile.dart' );
5454 expect (file.existsSync (), isTrue);
55-
55+
5656 final content = file.readAsStringSync ();
5757 expect (content, contains ('class Profile extends Model' ));
5858 });
@@ -66,7 +66,7 @@ void main() {
6666
6767 final migDir = Directory ('${tempDir .path }/lib/database/migrations' );
6868 expect (migDir.existsSync (), isTrue);
69-
69+
7070 final files = migDir.listSync ().whereType <File >().toList ();
7171 expect (files.length, equals (1 ));
7272 expect (files.first.path, contains ('_create_monitors_table.dart' ));
@@ -79,20 +79,36 @@ void main() {
7979 final modelFile = File ('${tempDir .path }/lib/app/models/monitor.dart' );
8080 expect (modelFile.existsSync (), isTrue);
8181
82- final ctrlFile = File ('${tempDir .path }/lib/app/controllers/monitor_controller.dart' );
82+ final ctrlFile =
83+ File ('${tempDir .path }/lib/app/controllers/monitor_controller.dart' );
8384 expect (ctrlFile.existsSync (), isTrue);
8485 });
8586
86- test ('--all flag creates model, migration, controller, factory, seeder, policy' , () async {
87+ test (
88+ '--all flag creates model, migration, controller, factory, seeder, policy' ,
89+ () async {
8790 cmd.arguments = parser.parse (['Monitor' , '--all' ]);
8891 await cmd.handle ();
8992
90- expect (File ('${tempDir .path }/lib/app/models/monitor.dart' ).existsSync (), isTrue);
91- expect (File ('${tempDir .path }/lib/app/controllers/monitor_controller.dart' ).existsSync (), isTrue);
92- expect (File ('${tempDir .path }/lib/database/factories/monitor_factory.dart' ).existsSync (), isTrue);
93- expect (File ('${tempDir .path }/lib/database/seeders/monitor_seeder.dart' ).existsSync (), isTrue);
94- expect (File ('${tempDir .path }/lib/app/policies/monitor_policy.dart' ).existsSync (), isTrue);
95-
93+ expect (File ('${tempDir .path }/lib/app/models/monitor.dart' ).existsSync (),
94+ isTrue);
95+ expect (
96+ File ('${tempDir .path }/lib/app/controllers/monitor_controller.dart' )
97+ .existsSync (),
98+ isTrue);
99+ expect (
100+ File ('${tempDir .path }/lib/database/factories/monitor_factory.dart' )
101+ .existsSync (),
102+ isTrue);
103+ expect (
104+ File ('${tempDir .path }/lib/database/seeders/monitor_seeder.dart' )
105+ .existsSync (),
106+ isTrue);
107+ expect (
108+ File ('${tempDir .path }/lib/app/policies/monitor_policy.dart' )
109+ .existsSync (),
110+ isTrue);
111+
96112 final migDir = Directory ('${tempDir .path }/lib/database/migrations' );
97113 final migFiles = migDir.listSync ().whereType <File >().toList ();
98114 expect (migFiles.length, equals (1 ));
0 commit comments