mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-04 20:29:08 -04:00
test(repository): divide groups into different files
This commit is contained in:
parent
5680fd8674
commit
ec8ff24e89
3 changed files with 374 additions and 369 deletions
35
test/repository_init_test.dart
Normal file
35
test/repository_init_test.dart
Normal file
|
@ -0,0 +1,35 @@
|
|||
import 'dart:io';
|
||||
import 'package:test/test.dart';
|
||||
import 'package:libgit2dart/libgit2dart.dart';
|
||||
|
||||
void main() {
|
||||
late Repository repo;
|
||||
final initDir = Directory('${Directory.systemTemp.path}/init_repo');
|
||||
|
||||
setUp(() async {
|
||||
if (await initDir.exists()) {
|
||||
await initDir.delete(recursive: true);
|
||||
} else {
|
||||
await initDir.create();
|
||||
}
|
||||
});
|
||||
|
||||
tearDown(() async {
|
||||
repo.free();
|
||||
await initDir.delete(recursive: true);
|
||||
});
|
||||
group('Repository.init', () {
|
||||
test('successfully creates new bare repo at provided path', () {
|
||||
repo = Repository.init(initDir.path, isBare: true);
|
||||
expect(repo.path, '${initDir.path}/');
|
||||
expect(repo.isBare, true);
|
||||
});
|
||||
|
||||
test('successfully creates new standard repo at provided path', () {
|
||||
repo = Repository.init(initDir.path);
|
||||
expect(repo.path, '${initDir.path}/.git/');
|
||||
expect(repo.isBare, false);
|
||||
expect(repo.isEmpty, true);
|
||||
});
|
||||
});
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue