mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-04 20:29:08 -04:00
feat(repository): add ability to initialize repository
This commit is contained in:
parent
543ebff223
commit
696d55bb3a
3 changed files with 59 additions and 1 deletions
|
@ -14,6 +14,36 @@ void main() {
|
|||
);
|
||||
});
|
||||
|
||||
group('.init()', () {
|
||||
final initDir = '${Directory.systemTemp.path}/init_repo/';
|
||||
|
||||
setUp(() async {
|
||||
if (await Directory(initDir).exists()) {
|
||||
await Directory(initDir).delete(recursive: true);
|
||||
} else {
|
||||
await Directory(initDir).create();
|
||||
}
|
||||
});
|
||||
|
||||
tearDown(() async {
|
||||
repo.free();
|
||||
await Directory(initDir).delete(recursive: true);
|
||||
});
|
||||
|
||||
test('successfully creates new bare repo at provided path', () {
|
||||
repo = Repository.init(initDir, isBare: true);
|
||||
expect(repo.path, initDir);
|
||||
expect(repo.isBare, true);
|
||||
});
|
||||
|
||||
test('successfully creates new standard repo at provided path', () {
|
||||
repo = Repository.init(initDir);
|
||||
expect(repo.path, '$initDir.git/');
|
||||
expect(repo.isBare, false);
|
||||
expect(repo.isEmpty, true);
|
||||
});
|
||||
});
|
||||
|
||||
group('empty', () {
|
||||
group('bare', () {
|
||||
setUp(() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue