mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-05 04:39:07 -04:00
feat(config): add ability to delete variable
This commit is contained in:
parent
2cdcccefc9
commit
4988b295a5
3 changed files with 40 additions and 3 deletions
|
@ -3,6 +3,7 @@ import 'dart:io';
|
|||
import 'package:test/test.dart';
|
||||
import 'package:libgit2dart/src/util.dart';
|
||||
import 'package:libgit2dart/src/config.dart';
|
||||
import 'package:libgit2dart/src/error.dart';
|
||||
|
||||
void main() {
|
||||
final tmpDir = Directory.systemTemp.path;
|
||||
|
@ -51,6 +52,18 @@ void main() {
|
|||
config.setVariable('remote.origin.url', 'updated');
|
||||
expect(config.variables['remote.origin.url'], equals('updated'));
|
||||
});
|
||||
|
||||
test('deletes variable', () {
|
||||
config.deleteVariable('core.bare');
|
||||
expect(config.variables['core.bare'], isNull);
|
||||
});
|
||||
|
||||
test('throws on deleting non existing variable', () {
|
||||
expect(
|
||||
() => config.deleteVariable('not.there'),
|
||||
throwsA(isA<LibGit2Error>()),
|
||||
);
|
||||
});
|
||||
});
|
||||
;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue