Skip to content

Commit b289b66

Browse files
committed
Add specs for entryWithPath:error:
1 parent f04fc75 commit b289b66

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

ObjectiveGitTests/GTTreeSpec.m

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,30 @@
9999
expect([tree entryWithName:@"_does not exist"]).to(beNil());
100100
});
101101

102+
describe(@"fetching entries from paths", ^{
103+
it(@"should be able to fetch existing paths",^{
104+
NSError *error = nil;
105+
GTTreeEntry *entry;
106+
107+
entry = [tree entryWithPath:@"README" error:&error];
108+
expect(error).to(beNil());
109+
expect(entry).notTo(beNil());
110+
111+
entry = [tree entryWithPath:@"subdir/README" error:&error];
112+
expect(error).to(beNil());
113+
expect(entry).notTo(beNil());
114+
});
115+
116+
it(@"should return nil and fill error for non-existent paths",^{
117+
NSError *error = nil;
118+
GTTreeEntry *entry;
119+
120+
entry = [tree entryWithPath:@"does/not/exist" error:&error];
121+
expect(error).notTo(beNil());
122+
expect(entry).to(beNil());
123+
});
124+
});
125+
102126
afterEach(^{
103127
[self tearDown];
104128
});

0 commit comments

Comments
 (0)