Skip to content

Commit 3c17305

Browse files
committed
Cleanup checkout+notify tests
1 parent 0e2ba10 commit 3c17305

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

ObjectiveGitTests/GTRepositorySpec.m

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -381,15 +381,13 @@
381381
});
382382

383383
describe(@"-checkout:strategy:notifyFlags:error:notifyBlock:progressBlock:", ^{
384-
it(@"should notify dirty file and stop ref checkout", ^{
384+
it(@"should fail ref checkout with dirty file and notify", ^{
385385
NSError *error = nil;
386386
GTReference *ref = [repository lookUpReferenceWithName:@"refs/heads/other-branch" error:&error];
387387
expect(ref).notTo(beNil());
388388
expect(error.localizedDescription).to(beNil());
389-
// Write something to a file in the repo
390389
BOOL writeResult = [@"Replacement data in main.m\n" writeToURL:[repository.fileURL URLByAppendingPathComponent:mainFile] atomically:YES encoding:NSUTF8StringEncoding error:&error];
391390
expect(@(writeResult)).to(beTruthy());
392-
// Now attempt to checkout the other-branch
393391
__block NSUInteger notifyCount = 0;
394392
__block BOOL mainFileDirty = NO;
395393
int (^notifyBlock)(GTCheckoutNotifyFlags, NSString *, GTDiffFile *, GTDiffFile *, GTDiffFile *);
@@ -410,14 +408,13 @@
410408
expect(@(error.code)).to(equal(@(GIT_EUSER)));
411409
});
412410

413-
it(@"should notify dirty file and stop commit checkout", ^{
411+
it(@"should fail commit checkout with dirty file and notify", ^{
414412
NSError *error = nil;
415413
GTCommit *commit = [repository lookUpObjectBySHA:@"1d69f3c0aeaf0d62e25591987b93b8ffc53abd77" objectType:GTObjectTypeCommit error:&error];
416414
expect(commit).notTo(beNil());
417415
expect(error.localizedDescription).to(beNil());
418416
BOOL writeResult = [@"Replacement data in README\n" writeToURL:[repository.fileURL URLByAppendingPathComponent:readmeFile] atomically:YES encoding:NSUTF8StringEncoding error:&error];
419417
expect(@(writeResult)).to(beTruthy());
420-
// Now attempt to checkout the other-branch
421418
__block NSUInteger notifyCount = 0;
422419
__block BOOL readmeFileDirty = NO;
423420
int (^notifyBlock)(GTCheckoutNotifyFlags, NSString *, GTDiffFile *, GTDiffFile *, GTDiffFile *);

0 commit comments

Comments
 (0)