Skip to content

Commit dbe237a

Browse files
committed
Fix remote tests by reloading config
1 parent af1cdca commit dbe237a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

ObjectiveGitTests/GTRemoteSpec.m

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,15 @@
1616

1717
__block GTRemote *remote = nil;
1818
__block GTRepository *repository = nil;
19+
__block GTConfiguration *configuration = nil;
1920
NSString *fetchRefspec = @"+refs/heads/*:refs/remotes/origin/*";
2021

2122
beforeEach(^{
2223
repository = self.testAppFixtureRepository;
2324
expect(repository).notTo(beNil());
2425

2526
NSError *error = nil;
26-
GTConfiguration *configuration = [repository configurationWithError:&error];
27+
configuration = [repository configurationWithError:&error];
2728
expect(configuration).notTo(beNil());
2829
expect(error).to(beNil());
2930

@@ -53,6 +54,9 @@
5354
expect(@([remote updateURLString:newURLString error:&error])).to(beTruthy());
5455
expect(error).to(beNil());
5556

57+
// Reload remote from disk to pick up the change
58+
remote = configuration.remotes[0];
59+
5660
expect(remote.URLString).to(equal(newURLString));
5761
});
5862

@@ -65,6 +69,9 @@
6569
expect(@([remote addFetchRefspec:newFetchRefspec error:&error])).to(beTruthy());
6670
expect(error).to(beNil());
6771

72+
// Reload remote from disk to pick up the change
73+
remote = configuration.remotes[0];
74+
6875
expect(remote.fetchRefspecs).to(equal((@[ fetchRefspec, newFetchRefspec ])));
6976
});
7077
});

0 commit comments

Comments
 (0)