mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-05 04:39:07 -04:00
test: disable repository owner verification for tests (#47)
This commit is contained in:
parent
f42f8a6e1b
commit
94c40f9a94
4 changed files with 61 additions and 4 deletions
|
@ -1,7 +1,9 @@
|
|||
import 'dart:io';
|
||||
import 'package:libgit2dart/libgit2dart.dart';
|
||||
import 'package:path/path.dart' as p;
|
||||
|
||||
Directory setupRepo(Directory repoDir) {
|
||||
Libgit2.ownerValidation = false;
|
||||
final tmpDir = Directory.systemTemp.createTempSync('testrepo');
|
||||
copyRepo(from: repoDir, to: tmpDir);
|
||||
return tmpDir;
|
||||
|
|
|
@ -14,5 +14,16 @@ void main() {
|
|||
{GitFeature.threads, GitFeature.https, GitFeature.ssh, GitFeature.nsec},
|
||||
);
|
||||
});
|
||||
|
||||
test(
|
||||
'sets and returns the owner validation setting for repository '
|
||||
'directories', () {
|
||||
final oldValue = Libgit2.ownerValidation;
|
||||
Libgit2.ownerValidation = !oldValue;
|
||||
expect(Libgit2.ownerValidation, equals(!oldValue));
|
||||
|
||||
// Set it back
|
||||
Libgit2.ownerValidation = oldValue;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue