Skip to content

Commit

Permalink
Merge pull request #7 from rafaelring/fix/test
Browse files Browse the repository at this point in the history
Make generator create a .showcased_test file instead of _test.showcased
  • Loading branch information
comigor authored Oct 15, 2018
2 parents 143251b + 1efc1fb commit b73d5ae
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class MyWidget extends StatelessWidget {
}
```

The builder will generate a `_test.showcased.dart` test file for each annotated class file. Just run:
The builder will generate a `.showcased_test.dart` test file for each annotated class file. Just run:
```shell
flutter packages pub run build_runner build
```
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/showcase_generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class _ShowcaseGenerator extends Generator {
final List<String> butFirst = originalFile.pathSegments.skip(1).toList()
..insert(0, 'test');
butFirst.add(butFirst.removeLast().replaceAllMapped(RegExp(r'^(.*)\.dart$'),
(Match match) => '${match[1]}_test.showcased.dart'));
(Match match) => '${match[1]}.showcased_test.dart'));
final Uri newPath = originalFile.replace(pathSegments: butFirst);
return File(newPath.path);
}
Expand Down

0 comments on commit b73d5ae

Please sign in to comment.