Skip to content

Commit 7b18b14

Browse files
committed
Added tests for GTRepository.shouldFileBeIgnored:success:error: and GTRepository.shouldIgnoreFileURL:error:
1 parent 4ad06b8 commit 7b18b14

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

ObjectiveGitTests/GTRepository+StatusSpec.m

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,24 @@
105105
expect(@(enumerationSuccessful)).to(beTruthy());
106106
expect(err).to(beNil());
107107
});
108+
109+
it(@"should report file should be ignored", ^{
110+
__block NSError *err = nil;
111+
NSURL *fileURL = [repository.fileURL URLByAppendingPathComponent:@".DS_Store"];
112+
BOOL success = NO;
113+
BOOL shouldIgnore = [repository shouldFileBeIgnored:fileURL success:&success error:&err];
114+
expect(@(success)).to(beTrue());
115+
expect(@(shouldIgnore)).to(beTrue());
116+
expect(err).to(beNil());
117+
});
118+
119+
it(@"should report file should be ignored (convenience wrapper)", ^{
120+
__block NSError *err = nil;
121+
NSURL *fileURL = [repository.fileURL URLByAppendingPathComponent:@".DS_Store"];
122+
GTFileIgnoreState ignore = [repository shouldIgnoreFileURL:fileURL error:&err];
123+
expect(@(ignore)).to(equal(@(GTFileIgnoreStateShouldIgnore)));
124+
expect(err).to(beNil());
125+
});
108126
});
109127

110128
afterEach(^{

0 commit comments

Comments
 (0)