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,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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue