test: fix odb test

This commit is contained in:
Aleksey Kulikov 2021-10-29 10:54:53 +03:00
parent 586aa0c6aa
commit 1e8bbbee9b

View file

@ -1,6 +1,6 @@
import 'dart:ffi';
import 'dart:io';
import 'package:cli_util/cli_logging.dart';
import 'package:libgit2dart/libgit2dart.dart';
import 'package:test/test.dart';
@ -31,15 +31,7 @@ void main() {
});
test('throws when trying to get odb and error occurs', () {
final logger = Logger.standard();
final objectsDir = Directory('${repo.workdir}.git/objects/');
logger.stdout(objectsDir.path);
objectsDir.deleteSync(recursive: true);
expect(objectsDir.existsSync(), false);
expect(
() => repo.odb,
throwsA(isA<LibGit2Error>()),
);
expect(() => Repository((nullptr)).odb, throwsA(isA<LibGit2Error>()));
});
test('successfully creates new odb with no backends', () {