test: remove checks for messages of throws

Platform specific messages for throws is different, so checking that test
throws proper type should be enough
This commit is contained in:
Aleksey Kulikov 2021-10-27 16:44:04 +03:00
parent 8791527ad9
commit 7f0cd86e72
35 changed files with 171 additions and 1331 deletions

View file

@ -33,13 +33,7 @@ void main() {
Directory('${repo.workdir}.git/objects/').deleteSync(recursive: true);
expect(
() => repo.odb,
throwsA(
isA<LibGit2Error>().having(
(e) => e.toString(),
'error',
contains("failed to load object database"),
),
),
throwsA(isA<LibGit2Error>()),
);
});
@ -77,13 +71,7 @@ void main() {
expect(
() => odb.read(repo['0' * 40]),
throwsA(
isA<LibGit2Error>().having(
(e) => e.toString(),
'error',
"odb: cannot read object: null OID cannot exist",
),
),
throwsA(isA<LibGit2Error>()),
);
odb.free();
@ -104,13 +92,7 @@ void main() {
expect(
() => odb.objects,
throwsA(
isA<LibGit2Error>().having(
(e) => e.toString(),
'error',
"object not found - failed to refresh packfiles",
),
),
throwsA(isA<LibGit2Error>()),
);
odb.free();
@ -132,13 +114,7 @@ void main() {
final odb = repo.odb;
expect(
() => odb.write(type: GitObject.any, data: 'testing'),
throwsA(
isA<ArgumentError>().having(
(e) => e.toString(),
'error',
'Invalid argument: "GitObject.any is invalid type"',
),
),
throwsA(isA<ArgumentError>()),
);
odb.free();
@ -150,13 +126,7 @@ void main() {
expect(
() => odb.write(type: GitObject.blob, data: ''),
throwsA(
isA<LibGit2Error>().having(
(e) => e.toString(),
'error',
"cannot write object - unsupported in the loaded odb backends",
),
),
throwsA(isA<LibGit2Error>()),
);
odb.free();