Skip to content

Commit 96b6365

Browse files
author
Ben Chatelain
committed
Add transfer progress blocks to push tests
Local transport doesn't currently call the progress callbacks
1 parent 3f22954 commit 96b6365

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

ObjectiveGitTests/GTRemotePushSpec.m

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,13 @@
101101
it(@"pushes nothing when the branch on local and remote are in sync", ^{
102102
NSError *error = nil;
103103

104-
BOOL result = [localRepo pushBranch:masterBranch toRemote:remote withOptions:nil error:&error progress:NULL];
104+
__block BOOL transferProgressed = NO;
105+
BOOL result = [localRepo pushBranch:masterBranch toRemote:remote withOptions:nil error:&error progress:^(unsigned int current, unsigned int total, size_t bytes, BOOL *stop) {
106+
transferProgressed = YES;
107+
}];
105108
expect(error).to(beNil());
106109
expect(@(result)).to(beTruthy());
110+
expect(@(transferProgressed)).to(beFalse()); // Local transport doesn't currently call progress callbacks
107111
});
108112

109113
it(@"pushes a new local commit to the remote", ^{
@@ -116,9 +120,13 @@
116120
expect(testCommit).notTo(beNil());
117121

118122
// Push
119-
BOOL result = [localRepo pushBranch:masterBranch toRemote:remote withOptions:nil error:&error progress:NULL];
123+
__block BOOL transferProgressed = NO;
124+
BOOL result = [localRepo pushBranch:masterBranch toRemote:remote withOptions:nil error:&error progress:^(unsigned int current, unsigned int total, size_t bytes, BOOL *stop) {
125+
transferProgressed = YES;
126+
}];
120127
expect(error).to(beNil());
121128
expect(@(result)).to(beTruthy());
129+
expect(@(transferProgressed)).to(beFalse()); // Local transport doesn't currently call progress callbacks
122130

123131
// Verify commit is in remote
124132
GTCommit *pushedCommit = [remoteRepo lookUpObjectByOID:testCommit.OID objectType:GTObjectTypeCommit error:&error];

0 commit comments

Comments
 (0)