test: fix tests failing on windows

This commit is contained in:
Aleksey Kulikov 2021-10-29 10:59:30 +03:00 committed by GitHub
parent f4e17b124d
commit a71bb14b86
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 26 additions and 34 deletions

View file

@ -1,5 +1,4 @@
import 'dart:ffi';
import 'dart:io';
import 'package:libgit2dart/libgit2dart.dart';
import 'package:test/test.dart';
@ -10,7 +9,7 @@ void main() {
group('Repository.open', () {
test("throws when repository isn't found at provided path", () {
expect(
() => Repository.open(''),
() => Repository.open('/not/there'),
throwsA(isA<LibGit2Error>()),
);
});
@ -33,17 +32,11 @@ void main() {
});
test('returns path to the repository', () {
expect(
repo.path,
'${Directory.current.path}/test/assets/empty_bare.git/',
);
expect(repo.path, contains('/test/assets/empty_bare.git/'));
});
test('returns path to root directory for the repository', () {
expect(
repo.commonDir,
'${Directory.current.path}/test/assets/empty_bare.git/',
);
expect(repo.commonDir, contains('/test/assets/empty_bare.git/'));
});
test('returns empty string as path of the working directory', () {
@ -65,16 +58,13 @@ void main() {
});
test('returns path to the repository', () {
expect(
repo.path,
'${Directory.current.path}/test/assets/empty_standard/.gitdir/',
);
expect(repo.path, contains('/test/assets/empty_standard/.gitdir/'));
});
test("returns path to parent repo's .git folder for the repository", () {
expect(
repo.commonDir,
'${Directory.current.path}/test/assets/empty_standard/.gitdir/',
contains('/test/assets/empty_standard/.gitdir/'),
);
});
@ -113,10 +103,7 @@ void main() {
});
test('returns path to working directory', () {
expect(
repo.workdir,
'${Directory.current.path}/test/assets/empty_standard/',
);
expect(repo.workdir, contains('/test/assets/empty_standard/'));
});
});
});