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

@ -40,24 +40,9 @@ void main() {
test('.single() throws when spec string not found or invalid', () {
expect(
() => repo.revParseSingle('invalid'),
throwsA(
isA<LibGit2Error>().having(
(e) => e.toString(),
'error',
"revspec 'invalid' not found",
),
),
);
expect(
() => repo.revParseSingle(''),
throwsA(
isA<LibGit2Error>().having(
(e) => e.toString(),
'error',
"failed to parse revision specifier - Invalid pattern ''",
),
),
throwsA(isA<LibGit2Error>()),
);
expect(() => repo.revParseSingle(''), throwsA(isA<LibGit2Error>()));
});
test('.ext() returns commit and reference', () {
@ -98,24 +83,9 @@ void main() {
test('.ext() throws when spec string not found or invalid', () {
expect(
() => repo.revParseExt('invalid'),
throwsA(
isA<LibGit2Error>().having(
(e) => e.toString(),
'error',
"revspec 'invalid' not found",
),
),
);
expect(
() => repo.revParseExt(''),
throwsA(
isA<LibGit2Error>().having(
(e) => e.toString(),
'error',
"failed to parse revision specifier - Invalid pattern ''",
),
),
throwsA(isA<LibGit2Error>()),
);
expect(() => repo.revParseExt(''), throwsA(isA<LibGit2Error>()));
});
test(
@ -156,23 +126,11 @@ void main() {
test('throws on invalid range spec', () {
expect(
() => repo.revParse('invalid..5aecfa'),
throwsA(
isA<LibGit2Error>().having(
(e) => e.toString(),
'error',
"revspec 'invalid' not found",
),
),
throwsA(isA<LibGit2Error>()),
);
expect(
() => repo.revParse('master.......5aecfa'),
throwsA(
isA<LibGit2Error>().having(
(e) => e.toString(),
'error',
"failed to parse revision specifier - Invalid pattern '....5aecfa'",
),
),
throwsA(isA<LibGit2Error>()),
);
});
});