refactor: extract repo setup for tests

This commit is contained in:
Aleksey Kulikov 2021-09-23 16:35:05 +03:00
parent 10b9864219
commit 466f960c7b
26 changed files with 176 additions and 320 deletions

View file

@ -1,14 +1,12 @@
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/'));
final repo = Repository.open(tmpDir);
final repo = Repository.open(tmpDir.path);
// Get list of repo's references.
print('Repository references: ${repo.references.list()}');
@ -39,5 +37,5 @@ void main() async {
repo.free();
// Removing example repository.
await disposeRepo(tmpDir);
await tmpDir.delete(recursive: true);
}