mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-04 20:29:08 -04:00
refactor!: use class names instead of aliases from Repository in tests (#37)
BREAKING CHANGE: move API methods related to diffing into Diff class
This commit is contained in:
parent
3e1ece4e6f
commit
08cbe8a17f
28 changed files with 943 additions and 834 deletions
|
@ -15,9 +15,7 @@ void main() {
|
|||
setUp(() {
|
||||
tmpDir = setupRepo(Directory(p.join('test', 'assets', 'test_repo')));
|
||||
repo = Repository.open(tmpDir.path);
|
||||
tree = repo.lookupTree(
|
||||
repo['a8ae3dd59e6e1802c6f78e05e301bfd57c9f334f'],
|
||||
);
|
||||
tree = Tree.lookup(repo: repo, oid: repo['a8ae3dd']);
|
||||
});
|
||||
|
||||
tearDown(() {
|
||||
|
@ -34,7 +32,7 @@ void main() {
|
|||
|
||||
test('throws when looking up tree for invalid oid', () {
|
||||
expect(
|
||||
() => repo.lookupTree(repo['0' * 40]),
|
||||
() => Tree.lookup(repo: repo, oid: repo['0' * 40]),
|
||||
throwsA(isA<LibGit2Error>()),
|
||||
);
|
||||
});
|
||||
|
@ -79,7 +77,7 @@ void main() {
|
|||
});
|
||||
|
||||
test('creates tree', () {
|
||||
final fileOid = repo.createBlob('blob content');
|
||||
final fileOid = Blob.create(repo: repo, content: 'blob content');
|
||||
final builder = TreeBuilder(repo: repo);
|
||||
|
||||
builder.add(
|
||||
|
@ -87,7 +85,7 @@ void main() {
|
|||
oid: fileOid,
|
||||
filemode: GitFilemode.blob,
|
||||
);
|
||||
final newTree = repo.lookupTree(builder.write());
|
||||
final newTree = Tree.lookup(repo: repo, oid: builder.write());
|
||||
|
||||
final entry = newTree['filename'];
|
||||
expect(newTree.length, 1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue