Skip to content

Commit

Permalink
Update test spec.
Browse files Browse the repository at this point in the history
  • Loading branch information
boidanny committed Dec 20, 2012
1 parent 46ce242 commit 3db616f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions ObjectiveGitTests/GTDiffSpec.m
Expand Up @@ -93,14 +93,14 @@
NSUInteger subtractionLine = 3;
NSUInteger additionLine = 4;
__block NSUInteger lineIndex = 0;
[hunk enumerateLinesInHunkUsingBlock:^(NSString *lineContent, NSUInteger oldLineNumber, NSUInteger newLineNumber, GTDiffHunkLineOrigin lineOrigin, BOOL *stop) {
expect(lineContent).to.equal(expectedLines[lineIndex]);
[hunk enumerateLinesInHunkUsingBlock:^(GTDiffLine *line, BOOL *stop) {
expect(line.content).to.equal(expectedLines[lineIndex]);
if (lineIndex == subtractionLine) {
expect((NSUInteger)lineOrigin).to.equal(GTDiffHunkLineOriginDeletion);
expect((NSUInteger)line.origin).to.equal(GTDiffLineOriginDeletion);
} else if (lineIndex == additionLine) {
expect((NSUInteger)lineOrigin).to.equal(GTDiffHunkLineOriginAddition);
expect((NSUInteger)line.origin).to.equal(GTDiffLineOriginAddition);
} else {
expect((NSUInteger)lineOrigin).to.equal(GTDiffHunkLineOriginContext);
expect((NSUInteger)line.origin).to.equal(GTDiffLineOriginContext);
}

lineIndex ++;
Expand Down Expand Up @@ -162,8 +162,8 @@
expect(delta.hunkCount).to.equal(1);
[delta enumerateHunksWithBlock:^(GTDiffHunk *hunk, BOOL *stop) {
__block NSUInteger contextCount = 0;
[hunk enumerateLinesInHunkUsingBlock:^(NSString *lineContent, NSUInteger oldLineNumber, NSUInteger newLineNumber, GTDiffHunkLineOrigin lineOrigin, BOOL *stop) {
if (lineOrigin == GTDiffHunkLineOriginContext) contextCount ++;
[hunk enumerateLinesInHunkUsingBlock:^(GTDiffLine *line, BOOL *stop) {
if (line.origin == GTDiffLineOriginContext) contextCount ++;
}];
expect(contextCount).to.equal(10);
*stop = YES;
Expand Down

0 comments on commit 3db616f

Please sign in to comment.