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
|
@ -5,26 +5,20 @@ import 'package:libgit2dart/libgit2dart.dart';
|
|||
import 'helpers/util.dart';
|
||||
|
||||
void main() {
|
||||
late Repository repo;
|
||||
late Directory tmpDir;
|
||||
const sha = '78b8bf123e3952c970ae5c1ce0a3ea1d1336f6e8';
|
||||
const biggerSha = '78b8bf123e3952c970ae5c1ce0a3ea1d1336f6e9';
|
||||
const lesserSha = '78b8bf123e3952c970ae5c1ce0a3ea1d1336f6e7';
|
||||
late Repository repo;
|
||||
final tmpDir = '${Directory.systemTemp.path}/oid_testrepo/';
|
||||
|
||||
setUp(() async {
|
||||
if (await Directory(tmpDir).exists()) {
|
||||
await Directory(tmpDir).delete(recursive: true);
|
||||
}
|
||||
await copyRepo(
|
||||
from: Directory('test/assets/testrepo/'),
|
||||
to: await Directory(tmpDir).create(),
|
||||
);
|
||||
repo = Repository.open(tmpDir);
|
||||
tmpDir = await setupRepo(Directory('test/assets/testrepo/'));
|
||||
repo = Repository.open(tmpDir.path);
|
||||
});
|
||||
|
||||
tearDown(() async {
|
||||
repo.free();
|
||||
await Directory(tmpDir).delete(recursive: true);
|
||||
await tmpDir.delete(recursive: true);
|
||||
});
|
||||
|
||||
group('Oid', () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue