mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-05 04:39:07 -04:00
test: fix tests failing on windows
This commit is contained in:
parent
59cf7174f6
commit
d86617d58b
3 changed files with 15 additions and 12 deletions
|
@ -122,7 +122,7 @@ void main() {
|
|||
|
||||
expect(clonedRepo.isEmpty, false);
|
||||
expect(clonedRepo.isBare, false);
|
||||
expect(clonedRepo.path, contains(p.join('callbackRepo', '.git')));
|
||||
expect(clonedRepo.path, contains('/callbackRepo/.git/'));
|
||||
|
||||
clonedRepo.free();
|
||||
callbackPath.deleteSync(recursive: true);
|
||||
|
|
|
@ -6,8 +6,6 @@ import 'package:test/test.dart';
|
|||
|
||||
void main() {
|
||||
late Repository repo;
|
||||
final barePath = p.join('test', 'assets', 'empty_bare.git');
|
||||
final standardPath = p.join('test', 'assets', 'empty_standard', '.gitdir');
|
||||
|
||||
group('Repository.open', () {
|
||||
test("throws when repository isn't found at provided path", () {
|
||||
|
@ -19,7 +17,7 @@ void main() {
|
|||
|
||||
group('empty bare', () {
|
||||
setUp(() {
|
||||
repo = Repository.open(barePath);
|
||||
repo = Repository.open(p.join('test', 'assets', 'empty_bare.git'));
|
||||
});
|
||||
|
||||
tearDown(() {
|
||||
|
@ -35,11 +33,11 @@ void main() {
|
|||
});
|
||||
|
||||
test('returns path to the repository', () {
|
||||
expect(repo.path, contains(barePath));
|
||||
expect(repo.path, contains('/test/assets/empty_bare.git/'));
|
||||
});
|
||||
|
||||
test('returns path to root directory for the repository', () {
|
||||
expect(repo.commonDir, contains(barePath));
|
||||
expect(repo.commonDir, contains('/test/assets/empty_bare.git/'));
|
||||
});
|
||||
|
||||
test('returns empty string as path of the working directory', () {
|
||||
|
@ -49,7 +47,9 @@ void main() {
|
|||
|
||||
group('empty standard', () {
|
||||
setUp(() {
|
||||
repo = Repository.open(standardPath);
|
||||
repo = Repository.open(
|
||||
p.join('test', 'assets', 'empty_standard', '.gitdir'),
|
||||
);
|
||||
});
|
||||
|
||||
tearDown(() {
|
||||
|
@ -61,11 +61,14 @@ void main() {
|
|||
});
|
||||
|
||||
test('returns path to the repository', () {
|
||||
expect(repo.path, contains(standardPath));
|
||||
expect(repo.path, contains('/test/assets/empty_standard/.gitdir/'));
|
||||
});
|
||||
|
||||
test("returns path to parent repo's .git folder for the repository", () {
|
||||
expect(repo.commonDir, contains(standardPath));
|
||||
expect(
|
||||
repo.commonDir,
|
||||
contains('/test/assets/empty_standard/.gitdir/'),
|
||||
);
|
||||
});
|
||||
|
||||
test('checks if it is empty', () {
|
||||
|
@ -105,7 +108,7 @@ void main() {
|
|||
test('returns path to working directory', () {
|
||||
expect(
|
||||
repo.workdir,
|
||||
contains(p.join('test', 'assets', 'empty_standard')),
|
||||
contains('/test/assets/empty_standard/'),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -31,7 +31,7 @@ void main() {
|
|||
test('creates new standard repo at provided path', () {
|
||||
repo = Repository.init(path: initDir.path);
|
||||
|
||||
expect(repo.path, contains(p.join('init_repo', '.git')));
|
||||
expect(repo.path, contains('init_repo/.git/'));
|
||||
expect(repo.isBare, false);
|
||||
expect(repo.isEmpty, true);
|
||||
});
|
||||
|
@ -44,7 +44,7 @@ void main() {
|
|||
flags: {GitRepositoryInit.mkdir, GitRepositoryInit.mkpath},
|
||||
);
|
||||
|
||||
expect(repo.path, contains(p.join('init_repo', '.git')));
|
||||
expect(repo.path, contains('init_repo/.git/'));
|
||||
expect(repo.isBare, false);
|
||||
expect(repo.isEmpty, true);
|
||||
expect(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue