mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-05 04:39:07 -04:00
refactor: extract repo setup for tests
This commit is contained in:
parent
10b9864219
commit
466f960c7b
26 changed files with 176 additions and 320 deletions
|
@ -1,13 +1,10 @@
|
|||
import 'dart:io';
|
||||
|
||||
import 'package:libgit2dart/libgit2dart.dart';
|
||||
|
||||
import 'helpers.dart';
|
||||
import '../test/helpers/util.dart';
|
||||
|
||||
void main() async {
|
||||
// Preparing example repository.
|
||||
final tmpDir = '${Directory.systemTemp.path}/example_repo/';
|
||||
await prepareRepo(tmpDir);
|
||||
final tmpDir = await setupRepo(Directory('test/assets/testrepo/'));
|
||||
|
||||
// Open system + global config file.
|
||||
final config = Config.open();
|
||||
|
@ -22,7 +19,7 @@ void main() async {
|
|||
// Open config file at provided path.
|
||||
// Exception is thrown if file not found.
|
||||
try {
|
||||
final repoConfig = Config.open('$tmpDir/.git/config');
|
||||
final repoConfig = Config.open('${tmpDir.path}/.git/config');
|
||||
|
||||
print('\nAll entries of repo config:');
|
||||
for (final entry in repoConfig) {
|
||||
|
@ -57,5 +54,5 @@ void main() async {
|
|||
}
|
||||
|
||||
// Removing example repository.
|
||||
await disposeRepo(tmpDir);
|
||||
await tmpDir.delete(recursive: true);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue